作者 tangxvhui

更新v2 版接口

@@ -217,7 +217,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que @@ -217,7 +217,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que
217 } 217 }
218 218
219 //根据周期获取,我的自评任务添加的邀请人 219 //根据周期获取,我的自评任务添加的邀请人
220 -func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListInviteUserQuery) (*adapter.AssessInviteUserResp, error) { 220 +func (srv StaffAssessServeice) ListAssessInviteUserV2(param *query.ListInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
221 transactionContext, err := factory.CreateTransactionContext(nil) 221 transactionContext, err := factory.CreateTransactionContext(nil)
222 if err != nil { 222 if err != nil {
223 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 223 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -50,7 +50,7 @@ func (c *StaffAssessControllerV2) AssessTaskMeDesc() { @@ -50,7 +50,7 @@ func (c *StaffAssessControllerV2) AssessTaskMeDesc() {
50 // 获取我要执行360评估,用户列表和评估填写的值 50 // 获取我要执行360评估,用户列表和评估填写的值
51 func (c *StaffAssessControllerV2) ListMeInviteUserAssess() { 51 func (c *StaffAssessControllerV2) ListMeInviteUserAssess() {
52 srv := service.NewStaffAssessServeice() 52 srv := service.NewStaffAssessServeice()
53 - paramReq := &query.ListInviteUserAssessQuery{} 53 + paramReq := &query.ListExecutorAssessQuery{}
54 err := c.BindJSON(paramReq) 54 err := c.BindJSON(paramReq)
55 if err != nil { 55 if err != nil {
56 e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) 56 e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
@@ -61,14 +61,14 @@ func (c *StaffAssessControllerV2) ListMeInviteUserAssess() { @@ -61,14 +61,14 @@ func (c *StaffAssessControllerV2) ListMeInviteUserAssess() {
61 userReq := middlewares.GetUser(c.Ctx) 61 userReq := middlewares.GetUser(c.Ctx)
62 paramReq.CompanyId = int(userReq.CompanyId) 62 paramReq.CompanyId = int(userReq.CompanyId)
63 paramReq.ExecutorId = int(userReq.UserId) 63 paramReq.ExecutorId = int(userReq.UserId)
64 - data, err := srv.ListExecutorInviteAssess(paramReq) 64 + data, err := srv.ListExecutorInviteAssessV2(paramReq)
65 c.Response(data, err) 65 c.Response(data, err)
66 } 66 }
67 67
68 // 获取我要执行的上级评估成员列表 68 // 获取我要执行的上级评估成员列表
69 func (c *StaffAssessControllerV2) ListMeSupperAssess() { 69 func (c *StaffAssessControllerV2) ListMeSupperAssess() {
70 srv := service.NewStaffAssessServeice() 70 srv := service.NewStaffAssessServeice()
71 - paramReq := &query.ListSupperAssessQuery{} 71 + paramReq := &query.ListExecutorAssessQuery{}
72 err := c.BindJSON(paramReq) 72 err := c.BindJSON(paramReq)
73 if err != nil { 73 if err != nil {
74 e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) 74 e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
@@ -79,6 +79,40 @@ func (c *StaffAssessControllerV2) ListMeSupperAssess() { @@ -79,6 +79,40 @@ func (c *StaffAssessControllerV2) ListMeSupperAssess() {
79 userReq := middlewares.GetUser(c.Ctx) 79 userReq := middlewares.GetUser(c.Ctx)
80 paramReq.CompanyId = int(userReq.CompanyId) 80 paramReq.CompanyId = int(userReq.CompanyId)
81 paramReq.ExecutorId = int(userReq.UserId) 81 paramReq.ExecutorId = int(userReq.UserId)
82 - data, err := srv.ListExecutorSupperAssess(paramReq) 82 + data, err := srv.ListExecutorSupperAssessV2(paramReq)
  83 + c.Response(data, err)
  84 +}
  85 +
  86 +// 获取我邀请的人
  87 +func (c *StaffAssessControllerV2) GetAssessMeInviteUser() {
  88 + srv := service.NewStaffAssessServeice()
  89 + paramReq := &query.ListInviteUserQuery{}
  90 + err := c.BindJSON(paramReq)
  91 + if err != nil {
  92 + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
  93 + c.Response(nil, e)
  94 + return
  95 + }
  96 + userReq := middlewares.GetUser(c.Ctx)
  97 + paramReq.CompanyId = int(userReq.CompanyId)
  98 + paramReq.TargetUserId = int(userReq.UserId)
  99 + data, err := srv.ListAssessInviteUserV2(paramReq)
  100 + c.Response(data, err)
  101 +}
  102 +
  103 +// 获取员工自评详情
  104 +func (c *StaffAssessControllerV2) GetAssessTargetUserSelfInfo() {
  105 + srv := service.NewStaffAssessServeice()
  106 + paramReq := &query.GetExecutorSelfAssessQuery{}
  107 + err := c.BindJSON(paramReq)
  108 + if err != nil {
  109 + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
  110 + c.Response(nil, e)
  111 + return
  112 + }
  113 + // paramReq.CompanyId = 1
  114 + userReq := middlewares.GetUser(c.Ctx)
  115 + paramReq.CompanyId = int(userReq.CompanyId)
  116 + data, err := srv.GetAssessSelfInfoV2(paramReq)
83 c.Response(data, err) 117 c.Response(data, err)
84 } 118 }
@@ -10,9 +10,9 @@ import ( @@ -10,9 +10,9 @@ import (
10 func init() { 10 func init() {
11 assessTaskNS := web.NewNamespace("/v1/staff-assess-task", 11 assessTaskNS := web.NewNamespace("/v1/staff-assess-task",
12 web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()), 12 web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()),
13 - web.NSCtrlPost("/search/me", (*controllers.StaffAssessController).SearchAssessTaskMe), //获取我参与过的评估项目列表  
14 - web.NSCtrlPost("/desc/me", (*controllers.StaffAssessController).AssessTaskMeDesc), //获取我的项目评估进度描述  
15 - web.NSCtrlPost("/", (*controllers.StaffAssessController).CreateStaffAssessTask), //创建员工的评估任务 13 + web.NSCtrlPost("/search/me", (*controllers.StaffAssessController).SearchAssessTaskMe), //获取我参与过的评估项目列表
  14 + web.NSCtrlPost("/desc/me", (*controllers.StaffAssessController).AssessTaskMeDesc), //获取我的项目评估进度描述
  15 + //web.NSCtrlPost("/", (*controllers.StaffAssessController).CreateStaffAssessTask), //创建员工的评估任务
16 web.NSCtrlGet("/cycle", (*controllers.StaffAssessController).ListAssessCycle), //获取周期列表 16 web.NSCtrlGet("/cycle", (*controllers.StaffAssessController).ListAssessCycle), //获取周期列表
17 web.NSCtrlPost("/cycle/day", (*controllers.StaffAssessController).ListAssessCycleDay), //获取周期中的考核日期 17 web.NSCtrlPost("/cycle/day", (*controllers.StaffAssessController).ListAssessCycleDay), //获取周期中的考核日期
18 web.NSCtrlPost("/cycle/day/content", (*controllers.StaffAssessController).ListAssessContentCycleDay), //根据周期里的考核日期,获取员工填写评估内容列表 18 web.NSCtrlPost("/cycle/day/content", (*controllers.StaffAssessController).ListAssessContentCycleDay), //根据周期里的考核日期,获取员工填写评估内容列表
@@ -33,8 +33,24 @@ func init() { @@ -33,8 +33,24 @@ func init() {
33 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessController).ListTargetUserInviteAssess), //获取被评估员工360评估的列表 33 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessController).ListTargetUserInviteAssess), //获取被评估员工360评估的列表
34 web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我的上级评估的列表 34 web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我的上级评估的列表
35 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessController).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情 35 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessController).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
  36 + )
  37 + //v2 改版
  38 + assessTaskV2NS := web.NewNamespace("/v2/staff-assess-task",
  39 + web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()),
  40 + web.NSCtrlPost("/search/me", (*controllers.StaffAssessControllerV2).SearchAssessTaskMe), //获取我参与过的评估项目列表
  41 + web.NSCtrlPost("/desc/me", (*controllers.StaffAssessControllerV2).AssessTaskMeDesc),
  42 + )
36 43
  44 + assessV2NS := web.NewNamespace("/v2/staff-assess",
  45 + web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()),
  46 + web.NSCtrlPost("/me/execute/invite/list", (*controllers.StaffAssessControllerV2).ListMeInviteUserAssess), //我要执行的360评估的用户列表
  47 + web.NSCtrlPost("/me/execute/supper/list", (*controllers.StaffAssessControllerV2).ListMeSupperAssess), //我要执行的360评估的用户列表
  48 + web.NSCtrlPost("/me/invite-user", (*controllers.StaffAssessControllerV2).GetAssessMeInviteUser), //获取邀请的员工
  49 + web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessControllerV2).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
37 ) 50 )
  51 +
38 web.AddNamespace(assessTaskNS) 52 web.AddNamespace(assessTaskNS)
39 web.AddNamespace(assessNS) 53 web.AddNamespace(assessNS)
  54 + web.AddNamespace(assessTaskV2NS)
  55 + web.AddNamespace(assessV2NS)
40 } 56 }