package com.red.circle.other.adapter.app.sys;


import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.cmd.sys.UserReportedCmd;
import com.red.circle.other.app.service.sys.SysFeedbackReportService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 被举报用户 前端控制器
 * </p>
 *
 * @author pengliang
 * @eo.api-type http
 * @eo.groupName 系统服务.被举报用户
 * @eo.path /sys/reported
 * @since 2019-10-31
 */
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/sys/reported", produces = MediaType.APPLICATION_JSON_VALUE)
public class ReportedRestController extends BaseController {

  private static final Logger log = LoggerFactory.getLogger(ReportedRestController.class);
  private final SysFeedbackReportService sysFeedbackReportService;

  /**
   * 添加举报信息.
   *
   * @eo.name 添加举报信息.
   * @eo.url
   * @eo.method post
   * @eo.request-type json
   */
  @PostMapping
  public void addReported(@RequestBody @Validated UserReportedCmd cmd) {
    cmd.setReqApiVersion("2");
    log.warn("add reported: {}", cmd);
    sysFeedbackReportService.addUserReported(cmd);
  }


}
