|
|
@ -1,9 +1,11 @@ |
|
|
|
package com.ccsens.mt.api; |
|
|
|
|
|
|
|
import com.ccsens.cloudutil.annotation.MustLogin; |
|
|
|
import com.ccsens.mt.bean.dto.TopicDto; |
|
|
|
import com.ccsens.mt.bean.vo.VoteVo; |
|
|
|
import com.ccsens.mt.service.IVoteService; |
|
|
|
import com.ccsens.util.JsonResponse; |
|
|
|
import com.ccsens.util.bean.dto.QueryDto; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -22,30 +24,33 @@ import java.util.List; |
|
|
|
* @author 逗 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Api(tags = "答题API", description = "") |
|
|
|
@Api(tags = "投票API", description = "") |
|
|
|
@RestController |
|
|
|
@RequestMapping("/vote") |
|
|
|
public class VoteController { |
|
|
|
@Resource |
|
|
|
private IVoteService voteService; |
|
|
|
|
|
|
|
@ApiOperation(value = "查询题目", notes = "") |
|
|
|
|
|
|
|
@MustLogin |
|
|
|
@ApiOperation(value = "用户投票", notes = "") |
|
|
|
@ApiImplicitParams({ |
|
|
|
}) |
|
|
|
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse saveVote(@RequestBody @ApiParam @Validated List<TopicDto.Group> groupList) throws Exception { |
|
|
|
log.info("查询题目:{}",groupList.toString()); |
|
|
|
voteService.saveVote(groupList); |
|
|
|
public JsonResponse saveVote(@RequestBody @ApiParam @Validated QueryDto<List<TopicDto.Group>> params) throws Exception { |
|
|
|
log.info("用户投票:{}",params.toString()); |
|
|
|
voteService.saveVote(params); |
|
|
|
return JsonResponse.newInstance().ok(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "查询题目", notes = "") |
|
|
|
@MustLogin |
|
|
|
@ApiOperation(value = "查询投票结果", notes = "") |
|
|
|
@ApiImplicitParams({ |
|
|
|
}) |
|
|
|
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse<List<VoteVo.GroupInfo>> queryVote(@RequestBody @ApiParam @Validated TopicDto.Project project) throws Exception { |
|
|
|
log.info("查询题目:{}",project.toString()); |
|
|
|
List<VoteVo.GroupInfo> groupInfoList = voteService.queryVote(project); |
|
|
|
public JsonResponse<List<VoteVo.GroupInfo>> queryVote(@RequestBody @ApiParam @Validated QueryDto<TopicDto.Project> params) throws Exception { |
|
|
|
log.info("查询投票结果:{}",params.toString()); |
|
|
|
List<VoteVo.GroupInfo> groupInfoList = voteService.queryVote(params); |
|
|
|
return JsonResponse.newInstance().ok(groupInfoList); |
|
|
|
} |
|
|
|
|
|
|
|