rk
7 小时以前 580f4d3c2ca9eee53eee95a4de2f6610b790780a
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
43
44
45
package com.doumee.api.web;
 
import com.doumee.config.annotation.LoginRequired;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.business.model.Zan;
import com.doumee.service.business.ZanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author 江蹄蹄
 * @date 2023/03/21 15:48
 */
 
 
@Api(tags = "用户点赞信息表")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/zan")
@Slf4j
public class ZanApi extends ApiController{
 
    @LoginRequired
    @ApiOperation("点赞")
    @PostMapping("/create")
    public ApiResponse create(@RequestBody Zan zan) {
        return ApiResponse.success(zanService.create(zan,getMemberId()));
    }
 
    @LoginRequired
    @ApiOperation("取消点赞")
    @PostMapping("/cancel")
    public ApiResponse cancel(@RequestBody Zan zan) {
        zanService.deleteById(zan,getMemberId());
        return ApiResponse.success(null);
    }
 
 
}