package com.yami.shop.api.controller;
|
|
import com.yami.shop.common.response.ResponseEnum;
|
import com.yami.shop.common.response.ServerResponseEntity;
|
import com.yami.shop.security.api.util.SecurityUtils;
|
import com.yami.shop.task.common.service.TaskUserService;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
|
@RestController
|
@RequestMapping("/p/taskRule")
|
@Tag(name = "任务规则API")
|
public class TaskRuleController {
|
|
@Autowired
|
private TaskUserService taskUserService;
|
|
@GetMapping("/updateTaskStatus")
|
@Operation(summary = "修改用户任务状态")
|
public ServerResponseEntity<?> updateTaskStatus(@RequestParam(value = "taskId") Long taskId, @RequestParam(value = "status") Integer status) {
|
String userId = SecurityUtils.getUser().getUserId();
|
Integer num = taskUserService.updateTaskStatus(taskId,status,userId);
|
if(num >0 ){
|
return ServerResponseEntity.success(ResponseEnum.OK.getMsg());
|
}else{
|
return ServerResponseEntity.showFailMsg(ResponseEnum.ERROR.getMsg());
|
}
|
}
|
}
|