diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java index 49462aa..0369134 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java @@ -46,7 +46,7 @@ public class WorkFlowController extends BaseController { */ @ApiOperation(value = "设置工作流的置顶状态") @GetMapping("/{id}/top") - public AjaxResult setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) { + public AjaxResult setWorkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) { workFlowService.setworkFlowTop(id, isTop); return AjaxResult.success(); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java index fead250..c7f1a86 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java @@ -262,8 +262,11 @@ public class SysUserController extends BaseController * @return */ @GetMapping("/selectUserById") - public AjaxResult selectUserById(){ - SysUser sysUser = userService.selectUserInfoById(SecurityUtils.getUserId()); + public AjaxResult selectUserById(@RequestParam Long id){ + if (id == null){ + id = SecurityUtils.getUserId(); + } + SysUser sysUser = userService.selectUserInfoById(id); return success(sysUser); } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java index 47a2aca..277192a 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java @@ -169,4 +169,11 @@ public class WorkFlow { @TableField(exist = false) private List typeList; + /** + * 是否关注 0关注 1未关注 + */ + @ApiModelProperty(value = "是否关注 0关注 1未关注") + @TableField(exist = false) + private Integer isAttention; + } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java index 2f82419..f407293 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java @@ -17,6 +17,7 @@ import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.StringUtils; import com.mcwl.common.utils.baidu.BaiduCensor; +import com.mcwl.resource.domain.SysUserAttention; import com.mcwl.resource.domain.WorkFlow; import com.mcwl.resource.domain.WorkFlowVersion; import com.mcwl.resource.domain.dto.AddRequestWorkFlow; @@ -24,6 +25,7 @@ import com.mcwl.resource.domain.dto.ModelImagePageRes; import com.mcwl.resource.domain.request.RequestWorkFlow; import com.mcwl.resource.domain.vo.PageVo; import com.mcwl.resource.domain.vo.WorkFlowVo; +import com.mcwl.resource.mapper.SysUserAttentionMapper; import com.mcwl.resource.mapper.WorkFlowMapper; import com.mcwl.resource.mapper.WorkFlowVersionMapper; import com.mcwl.resource.service.ToActivityService; @@ -61,6 +63,9 @@ public class WorkFlowServiceImpl extends ServiceImpl i @Autowired private ToActivityService toActivityService; + @Autowired + private SysUserAttentionMapper sysUserAttentionMapper; + @Autowired private ISysUserService sysUserService; @@ -383,7 +388,11 @@ public class WorkFlowServiceImpl extends ServiceImpl i } workFlow.setTypeList(strings); } - + workFlow.setIsAttention(0); + SysUserAttention sysUserAttention = sysUserAttentionMapper.selectAttention(SecurityUtils.getUserId(), workFlow.getUserId()); + if (sysUserAttention == null){ + workFlow.setIsAttention(1); + } return AjaxResult.success(workFlow); }