puhanshu
2021-12-30 12c595079a76967023895b701bd918b85adca5e5
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package com.panzhihua.service_community.api;
 
import javax.annotation.Resource;
 
import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO;
import com.panzhihua.service_community.service.McsConfigService;
import com.panzhihua.service_community.service.McsGameService;
import com.panzhihua.service_community.service.McsInformationService;
import com.panzhihua.service_community.service.McsMerchantService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.validated.AddGroup;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
 
import java.util.List;
 
/**
 * @title: MicroCommercialStreetApi
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 微商业街相关接口
 * @author: hans
 * @date: 2021/12/28 14:18
 */
@RestController
@RequestMapping("/microcommercialstreet")
public class MicroCommercialStreetApi {
 
    @Resource
    private McsMerchantService mcsMerchantService;
    @Resource
    private McsConfigService mcsConfigService;
    @Resource
    private McsGameService mcsGameService;
    @Resource
    private McsInformationService mcsInformationService;
 
    /**
     * 新增数字商业街商家
     * @param mcsMerchantDTO
     * @return
     */
    @PostMapping("/merchant/add")
    public R addMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO) {
        return mcsMerchantService.addMcsMerchant(mcsMerchantDTO);
    }
 
    /**
     * 编辑数字商业街商家
     * @param mcsMerchantDTO
     * @return
     */
    @PutMapping("/merchant/put")
    public R putMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO) {
        return mcsMerchantService.putMcsMerchant(mcsMerchantDTO);
    }
 
    /**
     * 查询数字商业街商家详情
     * @param merchantId
     * @return
     */
    @GetMapping("/merchant/get")
    public R getMcsMerchant(@RequestParam("merchantId") Long merchantId) {
        return mcsMerchantService.getMcsMerchant(merchantId);
    }
 
    /**
     * 删除数字商业街商家
     * @param merchantId
     * @param userId
     * @return
     */
    @DeleteMapping("/merchant/delete")
    public R deleteMcsMerchant(@RequestParam("merchantId") Long merchantId, @RequestParam("userId") Long userId) {
        return mcsMerchantService.deleteMcsMerchant(merchantId, userId);
    }
 
    /**
     * 分页查询数字商业街商家
     * @param pageMcsMerchantDTO
     * @return
     */
    @PostMapping("/merchant/page")
    public R pageMcsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO) {
        return mcsMerchantService.pageMcsMerchant(pageMcsMerchantDTO);
    }
 
    /**
     * 禁用/启用数字商业街商家
     * @param disableOrEnableMcsMerchantDTO
     * @return
     */
    @PutMapping("/merchant/disable-or-enable")
    public R disableOrEnableMcsMerchant(@RequestBody DisableOrEnableMcsMerchantDTO disableOrEnableMcsMerchantDTO) {
        return mcsMerchantService.disableOrEnableMcsMerchant(disableOrEnableMcsMerchantDTO);
    }
 
    /**
     * 获取所有数字商业街配置
     * @return
     */
    @GetMapping("/config/all")
    public R getAllMcsConfig() {
        return mcsConfigService.getAllMcsConfig();
    }
 
    /**
     * 修改数字商业街配置
     * @param configs
     * @return
     */
    @PutMapping("/config/put")
    public R putMcsConfig(@RequestBody List<McsConfigVO> configs) {
        return mcsConfigService.putMcsConfig(configs);
    }
 
    /**
     * 分页查询戳戳游戏
     * @param pageMcsGameDTO
     * @return
     */
    @PostMapping("/game/page")
    public R pageMcsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO) {
        return mcsGameService.pageMcsGame(pageMcsGameDTO);
    }
 
    /**
     * 设为/取消游戏热门
     * @param setPopularForGameDTO
     * @return
     */
    @PutMapping("/game/setPopular")
    public R setPopularForGame(@RequestBody SetPopularForGameDTO setPopularForGameDTO) {
        return mcsGameService.setPopularForGame(setPopularForGameDTO);
    }
 
    /**
     * 上架/下架戳戳游戏
     * @param setShelfForGameDTO
     * @return
     */
    @PutMapping("/game/setShelf")
    public R setShelfForGame(@RequestBody SetShelfForGameDTO setShelfForGameDTO) {
        return mcsGameService.setShelfForGame(setShelfForGameDTO);
    }
 
    /**
     * 删除戳戳游戏
     * @param gameId
     * @param userId
     * @return
     */
    @DeleteMapping("/game/delete")
    public R deleteMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) {
        return mcsGameService.deleteMcsGame(gameId, userId);
    }
 
    /**
     * 分页查询戳戳资讯
     * @param pageMcsInformationDTO
     * @return
     */
    @PostMapping("/information/page")
    public R pageMcsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO) {
        return mcsInformationService.pageMcsInfo(pageMcsInformationDTO);
    }
 
    /**
     * 上架/下架戳戳资讯
     * @param setShelfForInfoDTO
     * @return
     */
    @PutMapping("/information/setShelf")
    public R setShelfForMcsInfo(@RequestBody SetShelfForInfoDTO setShelfForInfoDTO) {
        return mcsInformationService.setShelfForMcsInfo(setShelfForInfoDTO);
    }
 
    /**
     * 删除戳戳资讯
     * @param infoId
     * @param userId
     * @return
     */
    @DeleteMapping("/information/delete")
    public R deleteMcsInfo(@RequestParam("infoId") Long infoId, @RequestParam("userId") Long userId) {
        return mcsInformationService.deleteMcsInfo(infoId, userId);
    }
}