正在显示
3 个修改的文件
包含
51 行增加
和
0 行删除
| @@ -898,6 +898,22 @@ func (srv TaskService) DeleteTaskInfo(param *command.GetTaskCommand) (*adapter.T | @@ -898,6 +898,22 @@ func (srv TaskService) DeleteTaskInfo(param *command.GetTaskCommand) (*adapter.T | ||
| 898 | if err != nil { | 898 | if err != nil { |
| 899 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "xx"+err.Error()) | 899 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "xx"+err.Error()) |
| 900 | } | 900 | } |
| 901 | + | ||
| 902 | + taskIgnoreRepo := factory.CreateTaskIgnoreRepository(map[string]interface{}{ | ||
| 903 | + "transactionContext": transactionContext, | ||
| 904 | + }) | ||
| 905 | + _, taskIgnoreList, err := taskIgnoreRepo.Find(map[string]interface{}{ | ||
| 906 | + "taskId": param.TaskId, | ||
| 907 | + }) | ||
| 908 | + if err != nil { | ||
| 909 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "xx"+err.Error()) | ||
| 910 | + } | ||
| 911 | + for _, v := range taskIgnoreList { | ||
| 912 | + err = taskIgnoreRepo.Remove(v.Id) | ||
| 913 | + if err != nil { | ||
| 914 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 915 | + } | ||
| 916 | + } | ||
| 901 | if err := transactionContext.CommitTransaction(); err != nil { | 917 | if err := transactionContext.CommitTransaction(); err != nil { |
| 902 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 918 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 903 | } | 919 | } |
| @@ -215,3 +215,36 @@ func (c *TaskController) SaveTaskLevel() { | @@ -215,3 +215,36 @@ func (c *TaskController) SaveTaskLevel() { | ||
| 215 | err = srv.SaveTaskLevel(paramReq) | 215 | err = srv.SaveTaskLevel(paramReq) |
| 216 | c.Response(nil, err) | 216 | c.Response(nil, err) |
| 217 | } | 217 | } |
| 218 | + | ||
| 219 | +// 取消关注的任务列表 | ||
| 220 | +func (c *TaskController) ListTaskIgnore() { | ||
| 221 | + srv := service.NewTaskService() | ||
| 222 | + paramReq := &command.SearchTaskCommand{} | ||
| 223 | + err := c.BindJSON(paramReq) | ||
| 224 | + if err != nil { | ||
| 225 | + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
| 226 | + c.Response(nil, e) | ||
| 227 | + return | ||
| 228 | + } | ||
| 229 | + userReq := middlewares.GetUser(c.Ctx) | ||
| 230 | + paramReq.CompanyId = int(userReq.CompanyId) | ||
| 231 | + result, err := srv.ListTaskIgnore(paramReq) | ||
| 232 | + c.Response(result, err) | ||
| 233 | +} | ||
| 234 | + | ||
| 235 | +// 从取消关注的任务列表中移除 | ||
| 236 | +func (c *TaskController) CancelIgnore() { | ||
| 237 | + srv := service.NewTaskService() | ||
| 238 | + paramReq := &command.CancelIgnoreCommand{} | ||
| 239 | + err := c.BindJSON(paramReq) | ||
| 240 | + if err != nil { | ||
| 241 | + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
| 242 | + c.Response(nil, e) | ||
| 243 | + return | ||
| 244 | + } | ||
| 245 | + userReq := middlewares.GetUser(c.Ctx) | ||
| 246 | + paramReq.CompanyId = int(userReq.CompanyId) | ||
| 247 | + _, err = srv.CancleTaskIgnore(paramReq) | ||
| 248 | + c.Response(nil, err) | ||
| 249 | + | ||
| 250 | +} |
| @@ -29,6 +29,8 @@ func init() { | @@ -29,6 +29,8 @@ func init() { | ||
| 29 | web.NSCtrlPost("/list/select", (*controllers.TaskController).SelectCondition), | 29 | web.NSCtrlPost("/list/select", (*controllers.TaskController).SelectCondition), |
| 30 | web.NSCtrlPost("/task_record/list", (*controllers.TaskController).ListTaskRecord), | 30 | web.NSCtrlPost("/task_record/list", (*controllers.TaskController).ListTaskRecord), |
| 31 | web.NSCtrlPost("/info", (*controllers.TaskController).GetTaskInfo), | 31 | web.NSCtrlPost("/info", (*controllers.TaskController).GetTaskInfo), |
| 32 | + web.NSCtrlPost("/ignore/list", (*controllers.TaskController).ListTaskIgnore), | ||
| 33 | + web.NSCtrlPost("/ignore/cancle", (*controllers.TaskController).CancelIgnore), | ||
| 32 | ) | 34 | ) |
| 33 | web.AddNamespace(taskFontNS) | 35 | web.AddNamespace(taskFontNS) |
| 34 | t := web.NewNamespace("/test/task", | 36 | t := web.NewNamespace("/test/task", |
-
请 注册 或 登录 后发表评论