-
Notifications
You must be signed in to change notification settings - Fork 0
/
todoHandler.go
68 lines (61 loc) · 1.5 KB
/
todoHandler.go
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
package handler
import (
"github.com/star-table/polaris-backend/common/core/errs"
"github.com/star-table/polaris-backend/common/model/vo"
"github.com/star-table/polaris-backend/common/model/vo/projectvo"
"github.com/star-table/polaris-backend/facade/projectfacade"
"github.com/gin-gonic/gin"
)
type todoHandler struct{}
var TodoHandler todoHandler
//func (todoHandler) Filter(c *gin.Context) {
// cacheUserInfo, sysErr := GetCacheUserInfo(c)
// if sysErr != nil {
// Fail(c, sysErr)
// return
// }
//
// req := vo.TodoFilterReq{}
// if err := c.BindJSON(&req); err != nil {
// Fail(c, errs.ReqParamsValidateError)
// return
// }
//
// respVo := projectfacade.TodoFilter(&projectvo.TodoFilterReq{
// OrgId: cacheUserInfo.OrgId,
// UserId: cacheUserInfo.UserId,
// Page: req.Page,
// Size: req.Size,
// FilterType: req.FilterType,
// })
// if respVo.Failure() {
// Fail(c, respVo.Error())
// } else {
// Success(c, respVo.Data)
// }
//}
func (todoHandler) Urge(c *gin.Context) {
cacheUserInfo, sysErr := GetCacheUserInfo(c)
if sysErr != nil {
Fail(c, sysErr)
return
}
req := vo.TodoUrgeReq{}
if err := c.BindJSON(&req); err != nil {
Fail(c, errs.ReqParamsValidateError)
return
}
respVo := projectfacade.TodoUrge(&projectvo.TodoUrgeReq{
OrgId: cacheUserInfo.OrgId,
UserId: cacheUserInfo.UserId,
Input: &projectvo.TodoUrgeInput{
TodoId: req.TodoId,
Msg: req.Msg,
},
})
if respVo.Failure() {
Fail(c, respVo.Error())
} else {
Success(c, respVo.Void)
}
}