luodangjia
2024-12-10 ee7ce5d1cbf80bee0a15c1e5bc5eaa30858d812b
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.hollywood.manage.controller;
 
 
import com.hollywood.common.basic.ApiResult;
import com.hollywood.common.basic.PageInfo;
import com.hollywood.common.model.TPerformerActivity;
import com.hollywood.common.model.TPerformerActivityUser;
import com.hollywood.manage.query.TPerformerActivityQuery;
import com.hollywood.manage.query.TPerformerActivityUserQuery;
import com.hollywood.manage.service.TPerformerActivityService;
import com.hollywood.manage.service.TPerformerActivityUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import java.time.LocalDateTime;
 
/**
 * <p>
 * 演员活动 前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2024-02-29
 */
@Api(tags = "演员活动")
@RestController
@RequestMapping("/tPerformerActivity")
public class TPerformerActivityController {
 
    private final TPerformerActivityService performerActivityService;
    private final TPerformerActivityUserService performerActivityUserService;
 
    @Autowired
    public TPerformerActivityController(TPerformerActivityService performerActivityService, TPerformerActivityUserService performerActivityUserService) {
        this.performerActivityService = performerActivityService;
        this.performerActivityUserService = performerActivityUserService;
    }
 
    /**
     * 获取演员活动列表
     */
    @ApiOperation(value = "获取演员活动分页列表")
    @PostMapping(value = "/pageList")
    public ApiResult<PageInfo<TPerformerActivity>> pageList(@RequestBody TPerformerActivityQuery query) {
        return ApiResult.success(performerActivityService.pageList(query));
    }
 
    /**
     * 获取演员活动参与人员列表
     */
    @ApiOperation(value = "获取演员活动参与人员列表")
    @PostMapping(value = "/userPageList")
    public ApiResult<PageInfo<TPerformerActivityUser>> userPageList(@Validated @RequestBody TPerformerActivityUserQuery query) {
        return ApiResult.success(performerActivityUserService.userPageList(query));
    }
 
    /**
     * 添加演员活动
     */
    @ApiOperation(value = "添加演员活动")
    @PostMapping(value = "/addTPerformerActivity")
    public ApiResult addTPerformerActivity(@RequestBody TPerformerActivity dto) {
        performerActivityService.judgeActivityStatus(dto);
        return ApiResult.success(performerActivityService.save(dto));
    }
 
    /**
     * 修改演员活动
     */
    @ApiOperation(value = "修改演员活动")
    @PostMapping(value = "/updateTPerformerActivity")
    public ApiResult updateTPerformerActivity(@RequestBody TPerformerActivity dto) {
        performerActivityService.judgeActivityStatus(dto);
        performerActivityService.updateTPerformerActivity(dto);
        return ApiResult.success();
    }
 
    /**
     * 查看演员活动详情
     */
    @ApiOperation(value = "查看演员活动详情")
    @GetMapping(value = "/getDetailById")
    public ApiResult<TPerformerActivity> getDetailById(@RequestParam Long id) {
        return ApiResult.success(performerActivityService.getById(id));
    }
 
    /**
     * 删除演员活动
     */
    @ApiOperation(value = "删除演员活动")
    @GetMapping(value = "/deleteById")
    public ApiResult deleteById(@RequestParam Long id) {
        return ApiResult.success(performerActivityService.removeById(id));
    }
 
    /**
     * 演员活动上下架
     */
    @ApiOperation(value = "演员活动上下架")
    @GetMapping(value = "/upAndDown")
    public ApiResult upAndDown(@RequestParam Long id,
                               @RequestParam Integer status) {
        return ApiResult.success(performerActivityService.upAndDown(id,status));
    }
 
}