package com.sinata.rest.modular.mall.controller;
|
|
import com.alibaba.fastjson.JSON;
|
import com.sinata.rest.common.ApiUtils;
|
import com.sinata.rest.modular.mall.controller.body.BodyUserReport;
|
import com.sinata.rest.modular.mall.model.MallUserReport;
|
import com.sinata.rest.modular.mall.service.IMallUserReportService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
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 chenhang
|
* @since 2023-03-11
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/mallUserReport")
|
//@Api(tags = "商城-商品举报", description = "商品举报")
|
public class MallUserReportController {
|
|
@Autowired
|
private IMallUserReportService mallUserReportService;
|
|
@PostMapping("/add")
|
@ApiOperation(value = "商品举报", notes = "商品举报", response = ApiUtils.class)
|
public Object add(@RequestBody BodyUserReport body){
|
MallUserReport userReport = JSON.parseObject(JSON.toJSONString(body), MallUserReport.class);
|
mallUserReportService.save(userReport);
|
return ApiUtils.returnOK();
|
}
|
|
}
|