mitao
2024-04-30 ab4ea7b8f10c9b66aed9c2ea161a08b25c3851a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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();
    }
 
}