增加周报评论及统计规则接口
							parent
							
								
									c1542a3433
								
							
						
					
					
						commit
						a491ea8672
					
				
							
								
								
									
										65
									
								
								README.md
								
								
								
								
							
							
						
						
									
										65
									
								
								README.md
								
								
								
								
							|  | @ -780,20 +780,57 @@ gin-vue-admin提供代码自动生成功能,选择数据库表结构,可直 | |||
| ``` | ||||
| // 周报 | ||||
| { | ||||
|     "id":100, | ||||
|     "header":"周报", | ||||
|     "userName":"xiaoming", | ||||
|     "sendTo": ["xiao1", "xiao2"], | ||||
|     "contents":[ | ||||
|         {"title":"本周工作", "content":"<strong>本周工作</strong>这里"}, | ||||
|         {"title":"下周计划", "content":"<p>下周计划在这</p>这里"} | ||||
|     ], | ||||
|     "pics":[ | ||||
|         { "key":"fe01ce2a7fbac8fafaed7c982a04e229_20211102170427.png", "name":"demo.png"} | ||||
|     ] | ||||
|     "attachments":[ | ||||
|         { "key":"fe01ce2a7fbac8fafaed7c982a04e220_20211102170428.c", "name":"demo.c"} | ||||
|     ] | ||||
|     "code": 0, | ||||
|     "data": { | ||||
|         "rewtReports": { | ||||
|             "ID": 100, | ||||
|             "CreatedAt": "2021-11-04T03:11:07Z", | ||||
|             "UpdatedAt": "2021-11-04T11:35:11Z", | ||||
|             "userName": "xiaoming", | ||||
|             "sendTo": [ | ||||
|                 { | ||||
|                     "ID": 1, | ||||
|                     "name": "xiao11" | ||||
|                 }, | ||||
|                 { | ||||
|                     "ID": 2, | ||||
|                     "name": "xiao21" | ||||
|                 } | ||||
|             ], | ||||
|             "header": "周报", | ||||
|             "contents": [ | ||||
|                 { | ||||
|                     "title": "本周工作", | ||||
|                     "content": "<strong>本周工作</strong>这里" | ||||
|                 }, | ||||
|                 { | ||||
|                     "title": "下周计划", | ||||
|                     "content": "<p>下周计划在这</p>这里" | ||||
|                 } | ||||
|             ], | ||||
|             "pictures": [ | ||||
|                 { | ||||
|                     "key": "fe01ce2a7fbac8fafaed7c982a04e229_20211102170427.png", | ||||
|                     "name": "demo.png" | ||||
|                 }, | ||||
|                 { | ||||
|                     "key": "fe01ce2a7fbac8fafaed7c982a04e229_20211102170420.png", | ||||
|                     "name": "demo1.png" | ||||
|                 } | ||||
|             ], | ||||
|             "attachments": [ | ||||
|                 { | ||||
|                     "key": "fe01ce2a7fbac8fafaed7c982a04e229_20211102170427.txt", | ||||
|                     "name": "demo.txt" | ||||
|                 }, | ||||
|                 { | ||||
|                     "key": "fe01ce2a7fbac8fafaed7c982a04e229_20211102170420.txt", | ||||
|                     "name": "demo1.txt" | ||||
|                 } | ||||
|             ] | ||||
|         } | ||||
|     }, | ||||
|     "msg": "操作成功" | ||||
| } | ||||
| 
 | ||||
| // 评论 | ||||
|  |  | |||
|  | @ -13,12 +13,12 @@ type ApiGroup struct { | |||
| 	SystemApi | ||||
| } | ||||
| 
 | ||||
| var userService = service.ServiceGroupApp.UserService | ||||
| var jwtService =  service.ServiceGroupApp.JwtService | ||||
| var menuService = service.ServiceGroupApp.MenuService | ||||
| var baseMenuService = service.ServiceGroupApp.BaseMenuService | ||||
| var systemConfigService = service.ServiceGroupApp.SystemConfigService | ||||
| var fileUploadAndDownloadService = service.ServiceGroupApp.FileUploadAndDownloadService | ||||
| var authorityService = service.ServiceGroupApp.AuthorityService | ||||
| var casbinService = service.ServiceGroupApp.CasbinService | ||||
| var userService = service.ServiceGroupApp.SystemServiceGroup.UserService | ||||
| var jwtService =  service.ServiceGroupApp.SystemServiceGroup.JwtService | ||||
| var menuService = service.ServiceGroupApp.SystemServiceGroup.MenuService | ||||
| var baseMenuService = service.ServiceGroupApp.SystemServiceGroup.BaseMenuService | ||||
| var systemConfigService = service.ServiceGroupApp.SystemServiceGroup.SystemConfigService | ||||
| var fileUploadAndDownloadService = service.ServiceGroupApp.SystemServiceGroup.FileUploadAndDownloadService | ||||
| var authorityService = service.ServiceGroupApp.SystemServiceGroup.AuthorityService | ||||
| var casbinService = service.ServiceGroupApp.SystemServiceGroup.CasbinService | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,12 +1,17 @@ | |||
| package wt | ||||
| 
 | ||||
| import "goweb-gin-demo/service" | ||||
| import ( | ||||
| 	"goweb-gin-demo/service" | ||||
| ) | ||||
| 
 | ||||
| type ApiWtGroup struct { | ||||
| 	WtReportsApi | ||||
| 	WtTemplateApi | ||||
| 	WtCommentApi | ||||
| 	WtRuleApi | ||||
| } | ||||
| 
 | ||||
| var wtReportsService = service.ServiceGroupApp.WtReportsService | ||||
| var wtTemplatesService = service.ServiceGroupApp.WtTemplateService | ||||
| 
 | ||||
| var wtReportsService = service.ServiceGroupApp.WtServiceGroup.WtReportsService | ||||
| var wtTemplatesService = service.ServiceGroupApp.WtServiceGroup.WtTemplateService | ||||
| var wtCommentService = service.ServiceGroupApp.WtServiceGroup.WtCommentService | ||||
| var wtRuleService = service.ServiceGroupApp.WtServiceGroup.WtRuleService | ||||
|  |  | |||
|  | @ -0,0 +1,121 @@ | |||
| package wt | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	"go.uber.org/zap" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/common/response" | ||||
| 	"goweb-gin-demo/model/wt" | ||||
| 	wtReq "goweb-gin-demo/model/wt/request" | ||||
| 	"strconv" | ||||
| ) | ||||
| 
 | ||||
| type WtCommentApi struct { | ||||
| } | ||||
| 
 | ||||
| // CreateWtComment 创建周报评论
 | ||||
| // @Tags WtComment
 | ||||
| // @Summary 创建周报评论
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data body wt.WtComment true "创建周报评论"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 | ||||
| // @Router /wtComment/createWtComment [post]
 | ||||
| func (wtCommentApi *WtCommentApi) CreateWtComment(c *gin.Context) { | ||||
| 	var wtComment wt.WtComment | ||||
| 	_ = c.ShouldBindJSON(&wtComment) | ||||
| 	if err := wtCommentService.CreateWtComment(wtComment); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("创建失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("创建失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithMessage("创建成功", c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // DeleteWtCommentByIds 批量删除周报评论
 | ||||
| // @Tags WtComment
 | ||||
| // @Summary 批量删除周报评论
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data body request.IdsReq true "批量删除周报评论"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
 | ||||
| // @Router /wtComment/deleteWtCommentByIds [delete]
 | ||||
| func (wtCommentApi *WtCommentApi) DeleteWtCommentByIds(c *gin.Context) { | ||||
| 	var IDS request.IdsReq | ||||
| 	_ = c.ShouldBindJSON(&IDS) | ||||
| 	if err := wtCommentService.DeleteWtCommentByIds(IDS); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("批量删除失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("批量删除失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithMessage("批量删除成功", c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // UpdateWtComment 更新周报评论
 | ||||
| // @Tags WtComment
 | ||||
| // @Summary 更新周报评论
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data body wt.WtComment true "更新周报评论"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
 | ||||
| // @Router /wtComment/updateWtComment [put]
 | ||||
| func (wtCommentApi *WtCommentApi) UpdateWtComment(c *gin.Context) { | ||||
| 	var wtComment wt.WtComment | ||||
| 	_ = c.ShouldBindJSON(&wtComment) | ||||
| 	if err := wtCommentService.UpdateWtComment(wtComment); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("更新失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("更新失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithMessage("更新成功", c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // FindWtComment 用id查询周报评论
 | ||||
| // @Tags WtComment
 | ||||
| // @Summary 用id查询周报评论
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data query request.GetById true "用id查询周报评论"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
 | ||||
| // @Router /wtComment/findWtComment [get]
 | ||||
| func (wtCommentApi *WtCommentApi) FindWtComment(c *gin.Context) { | ||||
| 	idStr := c.Query("id") | ||||
| 	id, _ := strconv.Atoi(idStr) | ||||
| 
 | ||||
| 	if err, rewtComment := wtCommentService.GetWtComment(uint(id)); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("查询失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("查询失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithData(gin.H{"rewtComment": rewtComment}, c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // GetWtCommentList 分页获取周报评论列表
 | ||||
| // @Tags WtComment
 | ||||
| // @Summary 分页获取周报评论列表
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data query wtReq.WtCommentSearch true "分页获取周报评论列表"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 | ||||
| // @Router /wtComment/getWtCommentList [get]
 | ||||
| func (wtCommentApi *WtCommentApi) GetWtCommentList(c *gin.Context) { | ||||
| 	var pageInfo wtReq.WtCommentSearch | ||||
| 	_ = c.ShouldBindQuery(&pageInfo) | ||||
| 	if err, list, total := wtCommentService.GetWtCommentInfoList(pageInfo); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("获取失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("获取失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithDetailed(response.PageResult{ | ||||
| 			List:     list, | ||||
| 			Total:    total, | ||||
| 			Page:     pageInfo.Page, | ||||
| 			PageSize: pageInfo.PageSize, | ||||
| 		}, "获取成功", c) | ||||
| 	} | ||||
| } | ||||
|  | @ -0,0 +1,121 @@ | |||
| package wt | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	"go.uber.org/zap" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/common/response" | ||||
| 	wtReq "goweb-gin-demo/model/wt/request" | ||||
| 	"strconv" | ||||
| ) | ||||
| 
 | ||||
| type WtRuleApi struct { | ||||
| } | ||||
| 
 | ||||
| // CreateWtRule 创建统计规则
 | ||||
| // @Tags WtRule
 | ||||
| // @Summary 创建统计规则
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data body request.WtRuleRes true "创建统计规则"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 | ||||
| // @Router /wtRule/createWtRule [post]
 | ||||
| func (wtRuleApi *WtRuleApi) CreateWtRule(c *gin.Context) { | ||||
| 	var ruleRes wtReq.WtRuleRes | ||||
| 	_ = c.ShouldBindJSON(&ruleRes) | ||||
| 
 | ||||
| 	if err := wtRuleService.CreateWtRule(ruleRes); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("创建失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("创建失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithMessage("创建成功", c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // DeleteWtRuleByIds 批量删除统计规则
 | ||||
| // @Tags WtRule
 | ||||
| // @Summary 批量删除统计规则
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data body request.IdsReq true "批量删除统计规则"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
 | ||||
| // @Router /wtRule/deleteWtRuleByIds [delete]
 | ||||
| func (wtRuleApi *WtRuleApi) DeleteWtRuleByIds(c *gin.Context) { | ||||
| 	var IDS request.IdsReq | ||||
| 	_ = c.ShouldBindJSON(&IDS) | ||||
| 	if err := wtRuleService.DeleteWtRuleByIds(IDS); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("批量删除失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("批量删除失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithMessage("批量删除成功", c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // UpdateWtRule 更新统计规则
 | ||||
| // @Tags WtRule
 | ||||
| // @Summary 更新统计规则
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data body request.WtRuleRes true "更新统计规则"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
 | ||||
| // @Router /wtRule/updateWtRule [put]
 | ||||
| func (wtRuleApi *WtRuleApi) UpdateWtRule(c *gin.Context) { | ||||
| 	var ruleRes wtReq.WtRuleRes | ||||
| 	_ = c.ShouldBindJSON(&ruleRes) | ||||
| 	if err := wtRuleService.UpdateWtRule(ruleRes); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("更新失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("更新失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithMessage("更新成功", c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // FindWtRule 用id查询统计规则
 | ||||
| // @Tags WtRule
 | ||||
| // @Summary 用id查询统计规则
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data query request.GetById true "用id查询统计规则"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
 | ||||
| // @Router /wtRule/findWtRule [get]
 | ||||
| func (wtRuleApi *WtRuleApi) FindWtRule(c *gin.Context) { | ||||
| 	idStr := c.Query("id") | ||||
| 	id, _ := strconv.Atoi(idStr) | ||||
| 
 | ||||
| 	if err, rewtRule := wtRuleService.GetWtRule(uint(id)); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("查询失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("查询失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithData(gin.H{"rewtRule": rewtRule}, c) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // GetWtRuleList 分页获取统计规则列表
 | ||||
| // @Tags WtRule
 | ||||
| // @Summary 分页获取统计规则列表
 | ||||
| // @Security ApiKeyAuth
 | ||||
| // @accept application/json
 | ||||
| // @Produce application/json
 | ||||
| // @Param data query wtReq.WtRuleSearch true "分页获取统计规则列表"
 | ||||
| // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
 | ||||
| // @Router /wtRule/getWtRuleList [get]
 | ||||
| func (wtRuleApi *WtRuleApi) GetWtRuleList(c *gin.Context) { | ||||
| 	var pageInfo wtReq.WtRuleSearch | ||||
| 	_ = c.ShouldBindQuery(&pageInfo) | ||||
| 	if err, list, total := wtRuleService.GetWtRuleInfoList(pageInfo); err != nil { | ||||
| 		global.GLOBAL_LOG.Error("获取失败!", zap.Any("err", err)) | ||||
| 		response.FailWithMessage("获取失败", c) | ||||
| 	} else { | ||||
| 		response.OkWithDetailed(response.PageResult{ | ||||
| 			List:     list, | ||||
| 			Total:    total, | ||||
| 			Page:     pageInfo.Page, | ||||
| 			PageSize: pageInfo.PageSize, | ||||
| 		}, "获取成功", c) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										521
									
								
								docs/docs.go
								
								
								
								
							
							
						
						
									
										521
									
								
								docs/docs.go
								
								
								
								
							|  | @ -1349,6 +1349,229 @@ var doc = `{ | |||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/createWtComment": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "创建周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "创建周报评论", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/wt.WtComment" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/deleteWtCommentByIds": { | ||||
|             "delete": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "批量删除周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "批量删除周报评论", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.IdsReq" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/findWtComment": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "用id查询周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "number", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/getWtCommentList": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "分页获取周报评论列表", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "comment", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "创建时间", | ||||
|                         "name": "createdAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "页码", | ||||
|                         "name": "page", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "每页大小", | ||||
|                         "name": "pageSize", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "name": "reportId", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "更新时间", | ||||
|                         "name": "updatedAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "userName", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/updateWtComment": { | ||||
|             "put": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "更新周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "更新周报评论", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/wt.WtComment" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtReports/createWtReports": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|  | @ -1587,6 +1810,234 @@ var doc = `{ | |||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/createWtRule": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "创建统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "创建统计规则", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtRuleRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/deleteWtRuleByIds": { | ||||
|             "delete": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "批量删除统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "批量删除统计规则", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.IdsReq" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/findWtRule": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "用id查询统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "number", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/getWtRuleList": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "分页获取统计规则列表", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "创建时间", | ||||
|                         "name": "createdAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "endTime", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "页码", | ||||
|                         "name": "page", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "每页大小", | ||||
|                         "name": "pageSize", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "reporters", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "startTime", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "更新时间", | ||||
|                         "name": "updatedAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "name": "userId", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/updateWtRule": { | ||||
|             "put": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "更新统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "更新统计规则", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtRuleRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtTemplates/createWtTemplate": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|  | @ -1611,7 +2062,7 @@ var doc = `{ | |||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtTemplateVO" | ||||
|                             "$ref": "#/definitions/request.WtTemplateRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|  | @ -1716,6 +2167,11 @@ var doc = `{ | |||
|                 ], | ||||
|                 "summary": "分页获取周报模板列表", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "attachments", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "contents", | ||||
|  | @ -1750,6 +2206,16 @@ var doc = `{ | |||
|                         "name": "pageSize", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "pictures", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "sendTo", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "更新时间", | ||||
|  | @ -1796,7 +2262,7 @@ var doc = `{ | |||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtTemplateVO" | ||||
|                             "$ref": "#/definitions/request.WtTemplateRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|  | @ -2403,7 +2869,30 @@ var doc = `{ | |||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "request.WtTemplateVO": { | ||||
|         "request.WtRuleRes": { | ||||
|             "type": "object", | ||||
|             "properties": { | ||||
|                 "endTime": { | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "id": { | ||||
|                     "type": "integer" | ||||
|                 }, | ||||
|                 "reporters": { | ||||
|                     "type": "array", | ||||
|                     "items": { | ||||
|                         "type": "string" | ||||
|                     } | ||||
|                 }, | ||||
|                 "startTime": { | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "userId": { | ||||
|                     "type": "integer" | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "request.WtTemplateRes": { | ||||
|             "type": "object", | ||||
|             "properties": { | ||||
|                 "contents": { | ||||
|  | @ -2669,6 +3158,32 @@ var doc = `{ | |||
|                     "type": "string" | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "wt.WtComment": { | ||||
|             "type": "object", | ||||
|             "properties": { | ||||
|                 "comment": { | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "createdAt": { | ||||
|                     "description": "创建时间", | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "id": { | ||||
|                     "description": "主键ID", | ||||
|                     "type": "integer" | ||||
|                 }, | ||||
|                 "reportId": { | ||||
|                     "type": "integer" | ||||
|                 }, | ||||
|                 "updatedAt": { | ||||
|                     "description": "更新时间", | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "userName": { | ||||
|                     "type": "string" | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| }` | ||||
|  |  | |||
|  | @ -1330,6 +1330,229 @@ | |||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/createWtComment": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "创建周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "创建周报评论", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/wt.WtComment" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/deleteWtCommentByIds": { | ||||
|             "delete": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "批量删除周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "批量删除周报评论", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.IdsReq" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/findWtComment": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "用id查询周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "number", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/getWtCommentList": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "分页获取周报评论列表", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "comment", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "创建时间", | ||||
|                         "name": "createdAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "页码", | ||||
|                         "name": "page", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "每页大小", | ||||
|                         "name": "pageSize", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "name": "reportId", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "更新时间", | ||||
|                         "name": "updatedAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "userName", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtComment/updateWtComment": { | ||||
|             "put": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtComment" | ||||
|                 ], | ||||
|                 "summary": "更新周报评论", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "更新周报评论", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/wt.WtComment" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtReports/createWtReports": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|  | @ -1568,6 +1791,234 @@ | |||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/createWtRule": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "创建统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "创建统计规则", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtRuleRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/deleteWtRuleByIds": { | ||||
|             "delete": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "批量删除统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "批量删除统计规则", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.IdsReq" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/findWtRule": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "用id查询统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "number", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/getWtRuleList": { | ||||
|             "get": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "分页获取统计规则列表", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "创建时间", | ||||
|                         "name": "createdAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "endTime", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "主键ID", | ||||
|                         "name": "id", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "页码", | ||||
|                         "name": "page", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "description": "每页大小", | ||||
|                         "name": "pageSize", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "reporters", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "startTime", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "更新时间", | ||||
|                         "name": "updatedAt", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "integer", | ||||
|                         "name": "userId", | ||||
|                         "in": "query" | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtRule/updateWtRule": { | ||||
|             "put": { | ||||
|                 "security": [ | ||||
|                     { | ||||
|                         "ApiKeyAuth": [] | ||||
|                     } | ||||
|                 ], | ||||
|                 "consumes": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "produces": [ | ||||
|                     "application/json" | ||||
|                 ], | ||||
|                 "tags": [ | ||||
|                     "WtRule" | ||||
|                 ], | ||||
|                 "summary": "更新统计规则", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "description": "更新统计规则", | ||||
|                         "name": "data", | ||||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtRuleRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|                 "responses": { | ||||
|                     "200": { | ||||
|                         "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", | ||||
|                         "schema": { | ||||
|                             "type": "string" | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "/wtTemplates/createWtTemplate": { | ||||
|             "post": { | ||||
|                 "security": [ | ||||
|  | @ -1592,7 +2043,7 @@ | |||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtTemplateVO" | ||||
|                             "$ref": "#/definitions/request.WtTemplateRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|  | @ -1697,6 +2148,11 @@ | |||
|                 ], | ||||
|                 "summary": "分页获取周报模板列表", | ||||
|                 "parameters": [ | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "attachments", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "contents", | ||||
|  | @ -1731,6 +2187,16 @@ | |||
|                         "name": "pageSize", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "pictures", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "name": "sendTo", | ||||
|                         "in": "query" | ||||
|                     }, | ||||
|                     { | ||||
|                         "type": "string", | ||||
|                         "description": "更新时间", | ||||
|  | @ -1777,7 +2243,7 @@ | |||
|                         "in": "body", | ||||
|                         "required": true, | ||||
|                         "schema": { | ||||
|                             "$ref": "#/definitions/request.WtTemplateVO" | ||||
|                             "$ref": "#/definitions/request.WtTemplateRes" | ||||
|                         } | ||||
|                     } | ||||
|                 ], | ||||
|  | @ -2384,7 +2850,30 @@ | |||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "request.WtTemplateVO": { | ||||
|         "request.WtRuleRes": { | ||||
|             "type": "object", | ||||
|             "properties": { | ||||
|                 "endTime": { | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "id": { | ||||
|                     "type": "integer" | ||||
|                 }, | ||||
|                 "reporters": { | ||||
|                     "type": "array", | ||||
|                     "items": { | ||||
|                         "type": "string" | ||||
|                     } | ||||
|                 }, | ||||
|                 "startTime": { | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "userId": { | ||||
|                     "type": "integer" | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "request.WtTemplateRes": { | ||||
|             "type": "object", | ||||
|             "properties": { | ||||
|                 "contents": { | ||||
|  | @ -2650,6 +3139,32 @@ | |||
|                     "type": "string" | ||||
|                 } | ||||
|             } | ||||
|         }, | ||||
|         "wt.WtComment": { | ||||
|             "type": "object", | ||||
|             "properties": { | ||||
|                 "comment": { | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "createdAt": { | ||||
|                     "description": "创建时间", | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "id": { | ||||
|                     "description": "主键ID", | ||||
|                     "type": "integer" | ||||
|                 }, | ||||
|                 "reportId": { | ||||
|                     "type": "integer" | ||||
|                 }, | ||||
|                 "updatedAt": { | ||||
|                     "description": "更新时间", | ||||
|                     "type": "string" | ||||
|                 }, | ||||
|                 "userName": { | ||||
|                     "type": "string" | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | @ -408,7 +408,22 @@ definitions: | |||
|       userName: | ||||
|         type: string | ||||
|     type: object | ||||
|   request.WtTemplateVO: | ||||
|   request.WtRuleRes: | ||||
|     properties: | ||||
|       endTime: | ||||
|         type: string | ||||
|       id: | ||||
|         type: integer | ||||
|       reporters: | ||||
|         items: | ||||
|           type: string | ||||
|         type: array | ||||
|       startTime: | ||||
|         type: string | ||||
|       userId: | ||||
|         type: integer | ||||
|     type: object | ||||
|   request.WtTemplateRes: | ||||
|     properties: | ||||
|       contents: | ||||
|         items: | ||||
|  | @ -594,6 +609,24 @@ definitions: | |||
|       name: | ||||
|         type: string | ||||
|     type: object | ||||
|   wt.WtComment: | ||||
|     properties: | ||||
|       comment: | ||||
|         type: string | ||||
|       createdAt: | ||||
|         description: 创建时间 | ||||
|         type: string | ||||
|       id: | ||||
|         description: 主键ID | ||||
|         type: integer | ||||
|       reportId: | ||||
|         type: integer | ||||
|       updatedAt: | ||||
|         description: 更新时间 | ||||
|         type: string | ||||
|       userName: | ||||
|         type: string | ||||
|     type: object | ||||
| info: | ||||
|   contact: {} | ||||
| paths: | ||||
|  | @ -1399,6 +1432,142 @@ paths: | |||
|       summary: 设置用户信息 | ||||
|       tags: | ||||
|       - SysUser | ||||
|   /wtComment/createWtComment: | ||||
|     post: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 创建周报评论 | ||||
|         in: body | ||||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/wt.WtComment' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"获取成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 创建周报评论 | ||||
|       tags: | ||||
|       - WtComment | ||||
|   /wtComment/deleteWtCommentByIds: | ||||
|     delete: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 批量删除周报评论 | ||||
|         in: body | ||||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/request.IdsReq' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"批量删除成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 批量删除周报评论 | ||||
|       tags: | ||||
|       - WtComment | ||||
|   /wtComment/findWtComment: | ||||
|     get: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 主键ID | ||||
|         in: query | ||||
|         name: id | ||||
|         type: number | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"查询成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 用id查询周报评论 | ||||
|       tags: | ||||
|       - WtComment | ||||
|   /wtComment/getWtCommentList: | ||||
|     get: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - in: query | ||||
|         name: comment | ||||
|         type: string | ||||
|       - description: 创建时间 | ||||
|         in: query | ||||
|         name: createdAt | ||||
|         type: string | ||||
|       - description: 主键ID | ||||
|         in: query | ||||
|         name: id | ||||
|         type: integer | ||||
|       - description: 页码 | ||||
|         in: query | ||||
|         name: page | ||||
|         type: integer | ||||
|       - description: 每页大小 | ||||
|         in: query | ||||
|         name: pageSize | ||||
|         type: integer | ||||
|       - in: query | ||||
|         name: reportId | ||||
|         type: integer | ||||
|       - description: 更新时间 | ||||
|         in: query | ||||
|         name: updatedAt | ||||
|         type: string | ||||
|       - in: query | ||||
|         name: userName | ||||
|         type: string | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"获取成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 分页获取周报评论列表 | ||||
|       tags: | ||||
|       - WtComment | ||||
|   /wtComment/updateWtComment: | ||||
|     put: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 更新周报评论 | ||||
|         in: body | ||||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/wt.WtComment' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"更新成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 更新周报评论 | ||||
|       tags: | ||||
|       - WtComment | ||||
|   /wtReports/createWtReports: | ||||
|     post: | ||||
|       consumes: | ||||
|  | @ -1544,6 +1713,145 @@ paths: | |||
|       summary: 更新周报 | ||||
|       tags: | ||||
|       - WtReports | ||||
|   /wtRule/createWtRule: | ||||
|     post: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 创建统计规则 | ||||
|         in: body | ||||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/request.WtRuleRes' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"获取成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 创建统计规则 | ||||
|       tags: | ||||
|       - WtRule | ||||
|   /wtRule/deleteWtRuleByIds: | ||||
|     delete: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 批量删除统计规则 | ||||
|         in: body | ||||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/request.IdsReq' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"批量删除成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 批量删除统计规则 | ||||
|       tags: | ||||
|       - WtRule | ||||
|   /wtRule/findWtRule: | ||||
|     get: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 主键ID | ||||
|         in: query | ||||
|         name: id | ||||
|         type: number | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"查询成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 用id查询统计规则 | ||||
|       tags: | ||||
|       - WtRule | ||||
|   /wtRule/getWtRuleList: | ||||
|     get: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 创建时间 | ||||
|         in: query | ||||
|         name: createdAt | ||||
|         type: string | ||||
|       - in: query | ||||
|         name: endTime | ||||
|         type: string | ||||
|       - description: 主键ID | ||||
|         in: query | ||||
|         name: id | ||||
|         type: integer | ||||
|       - description: 页码 | ||||
|         in: query | ||||
|         name: page | ||||
|         type: integer | ||||
|       - description: 每页大小 | ||||
|         in: query | ||||
|         name: pageSize | ||||
|         type: integer | ||||
|       - in: query | ||||
|         name: reporters | ||||
|         type: string | ||||
|       - in: query | ||||
|         name: startTime | ||||
|         type: string | ||||
|       - description: 更新时间 | ||||
|         in: query | ||||
|         name: updatedAt | ||||
|         type: string | ||||
|       - in: query | ||||
|         name: userId | ||||
|         type: integer | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"获取成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 分页获取统计规则列表 | ||||
|       tags: | ||||
|       - WtRule | ||||
|   /wtRule/updateWtRule: | ||||
|     put: | ||||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - description: 更新统计规则 | ||||
|         in: body | ||||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/request.WtRuleRes' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|         "200": | ||||
|           description: '{"success":true,"data":{},"msg":"更新成功"}' | ||||
|           schema: | ||||
|             type: string | ||||
|       security: | ||||
|       - ApiKeyAuth: [] | ||||
|       summary: 更新统计规则 | ||||
|       tags: | ||||
|       - WtRule | ||||
|   /wtTemplates/createWtTemplate: | ||||
|     post: | ||||
|       consumes: | ||||
|  | @ -1554,7 +1862,7 @@ paths: | |||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/request.WtTemplateVO' | ||||
|           $ref: '#/definitions/request.WtTemplateRes' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|  | @ -1616,6 +1924,9 @@ paths: | |||
|       consumes: | ||||
|       - application/json | ||||
|       parameters: | ||||
|       - in: query | ||||
|         name: attachments | ||||
|         type: string | ||||
|       - in: query | ||||
|         name: contents | ||||
|         type: string | ||||
|  | @ -1638,6 +1949,12 @@ paths: | |||
|         in: query | ||||
|         name: pageSize | ||||
|         type: integer | ||||
|       - in: query | ||||
|         name: pictures | ||||
|         type: string | ||||
|       - in: query | ||||
|         name: sendTo | ||||
|         type: string | ||||
|       - description: 更新时间 | ||||
|         in: query | ||||
|         name: updatedAt | ||||
|  | @ -1667,7 +1984,7 @@ paths: | |||
|         name: data | ||||
|         required: true | ||||
|         schema: | ||||
|           $ref: '#/definitions/request.WtTemplateVO' | ||||
|           $ref: '#/definitions/request.WtTemplateRes' | ||||
|       produces: | ||||
|       - application/json | ||||
|       responses: | ||||
|  |  | |||
							
								
								
									
										
											BIN
										
									
								
								goweb-gin-demo
								
								
								
								
							
							
						
						
									
										
											BIN
										
									
								
								goweb-gin-demo
								
								
								
								
							
										
											Binary file not shown.
										
									
								
							|  | @ -42,6 +42,7 @@ func Routers() *gin.Engine { | |||
| 		RouterGroup.InitFileUploadAndDownloadRouter(PrivateGroup) | ||||
| 		RouterGroup.InitAuthorityRouter(PrivateGroup) | ||||
| 		RouterGroup.InitWtReportsRouter(PrivateGroup) | ||||
| 		RouterGroup.InitWtRuleRouter(PrivateGroup) | ||||
| 	} | ||||
| 
 | ||||
| 	global.GLOBAL_LOG.Info("router register success") | ||||
|  |  | |||
|  | @ -1 +1 @@ | |||
| log/2021-11-04.log | ||||
| log/2021-11-05.log | ||||
|  | @ -0,0 +1,29 @@ | |||
| [goweb-demo]2021/11/05 - 09:04:23.221	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:47	router register success | ||||
| [goweb-demo]2021/11/05 - 09:04:23.223	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 09:10:09.982	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38	accept tcp [::]:8889: use of closed network connection | ||||
| [goweb-demo]2021/11/05 - 09:10:17.846	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:47	router register success | ||||
| [goweb-demo]2021/11/05 - 09:10:17.847	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 10:33:46.120	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38	accept tcp [::]:8889: use of closed network connection | ||||
| [goweb-demo]2021/11/05 - 11:14:00.392	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:47	router register success | ||||
| [goweb-demo]2021/11/05 - 11:14:00.394	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 11:28:40.712	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38	accept tcp [::]:8889: use of closed network connection | ||||
| [goweb-demo]2021/11/05 - 11:37:11.227	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:48	router register success | ||||
| [goweb-demo]2021/11/05 - 11:37:11.230	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 11:37:44.494	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38	accept tcp [::]:8889: use of closed network connection | ||||
| [goweb-demo]2021/11/05 - 11:37:51.391	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:48	router register success | ||||
| [goweb-demo]2021/11/05 - 11:37:51.397	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 11:39:39.024	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/api/wt/wt_comments.go:30	创建失败!	{"err": "Error 1048: Column 'report_id' cannot be null"} | ||||
| [goweb-demo]2021/11/05 - 11:43:45.723	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38	accept tcp [::]:8889: use of closed network connection | ||||
| [goweb-demo]2021/11/05 - 11:43:58.720	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:48	router register success | ||||
| [goweb-demo]2021/11/05 - 11:43:58.721	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 11:45:15.899	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:48	router register success | ||||
| [goweb-demo]2021/11/05 - 11:45:15.900	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 11:50:45.851	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:48	router register success | ||||
| [goweb-demo]2021/11/05 - 11:50:45.852	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 11:53:06.019	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/api/wt/wt_comments.go:30	创建失败!	{"err": "Error 1062: Duplicate entry '1' for key 'PRIMARY'"} | ||||
| [goweb-demo]2021/11/05 - 12:15:59.500	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38	accept tcp [::]:8889: use of closed network connection | ||||
| [goweb-demo]2021/11/05 - 12:16:53.847	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:48	router register success | ||||
| [goweb-demo]2021/11/05 - 12:16:53.849	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
| [goweb-demo]2021/11/05 - 12:17:41.333	[31merror[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38	accept tcp [::]:8889: use of closed network connection | ||||
| [goweb-demo]2021/11/05 - 12:17:49.963	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:48	router register success | ||||
| [goweb-demo]2021/11/05 - 12:17:49.965	[34minfo[0m	/Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31	server run success on 	{"address": ":8889"} | ||||
|  | @ -8,7 +8,7 @@ import ( | |||
| 	"goweb-gin-demo/service" | ||||
| ) | ||||
| 
 | ||||
| var casbinService = service.ServiceGroupApp.CasbinService | ||||
| var casbinService = service.ServiceGroupApp.SystemServiceGroup.CasbinService | ||||
| 
 | ||||
| // 拦截器
 | ||||
| func CasbinHandler() gin.HandlerFunc { | ||||
|  |  | |||
|  | @ -1,20 +1,19 @@ | |||
| package middleware | ||||
| 
 | ||||
| import ( | ||||
| 	"goweb-gin-demo/service" | ||||
| 	"goweb-gin-demo/utils" | ||||
| 	"strconv" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	"go.uber.org/zap" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/response" | ||||
| 	"goweb-gin-demo/model/web" | ||||
| 	"goweb-gin-demo/service" | ||||
| 
 | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	"go.uber.org/zap" | ||||
| ) | ||||
| 
 | ||||
| var jwtService = service.ServiceGroupApp.JwtService | ||||
| var jwtService = service.ServiceGroupApp.SystemServiceGroup.JwtService | ||||
| 
 | ||||
| func JWTAuth() gin.HandlerFunc { | ||||
| 	return func(c *gin.Context) { | ||||
|  |  | |||
|  | @ -2,20 +2,20 @@ package middleware | |||
| 
 | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"goweb-gin-demo/service" | ||||
| 	"io/ioutil" | ||||
| 	"net/http" | ||||
| 	"strconv" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	"go.uber.org/zap" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/web" | ||||
| 	"goweb-gin-demo/model/web/request" | ||||
| 	"goweb-gin-demo/service" | ||||
| 	"go.uber.org/zap" | ||||
| ) | ||||
| 
 | ||||
| var operationRecordService = service.ServiceGroupApp.OperationRecordService | ||||
| var operationRecordService = service.ServiceGroupApp.SystemServiceGroup.OperationRecordService | ||||
| 
 | ||||
| func OperationRecord() gin.HandlerFunc { | ||||
| 	return func(c *gin.Context) { | ||||
|  |  | |||
|  | @ -0,0 +1,11 @@ | |||
| package request | ||||
| 
 | ||||
| import ( | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/wt" | ||||
| ) | ||||
| 
 | ||||
| type WtCommentSearch struct{ | ||||
|     wt.WtComment | ||||
|     request.PageInfo | ||||
| } | ||||
|  | @ -0,0 +1,19 @@ | |||
| package request | ||||
| 
 | ||||
| import ( | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/wt" | ||||
| ) | ||||
| 
 | ||||
| type WtRuleSearch struct{ | ||||
|     wt.WtRule | ||||
|     request.PageInfo | ||||
| } | ||||
| 
 | ||||
| type WtRuleRes struct { | ||||
| 	ID uint | ||||
| 	UserId  int | ||||
| 	Reporters  []string | ||||
| 	StartTime  string | ||||
| 	EndTime  string | ||||
| } | ||||
|  | @ -0,0 +1,11 @@ | |||
| package response | ||||
| 
 | ||||
| import "goweb-gin-demo/global" | ||||
| 
 | ||||
| type WtRuleResult struct { | ||||
| 	global.GLOBAL_MODEL | ||||
| 	UserId    int | ||||
| 	Reporters []string | ||||
| 	StartTime string | ||||
| 	EndTime   string | ||||
| } | ||||
|  | @ -0,0 +1,20 @@ | |||
| package wt | ||||
| 
 | ||||
| import ( | ||||
| 	"goweb-gin-demo/global" | ||||
| ) | ||||
| 
 | ||||
| // WtComment 结构体
 | ||||
| type WtComment struct { | ||||
|       global.GLOBAL_MODEL | ||||
|       ReportId  int `json:"reportId" form:"reportId" gorm:"column:report_id;comment:报告id;type:bigint"` | ||||
|       UserName  string `json:"userName" form:"userName" gorm:"column:user_name;comment:评论的用户;type:varchar(100);"` | ||||
|       Comment  string `json:"comment" form:"comment" gorm:"column:comment;comment:评论;type:text;"` | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| // TableName WtComment 表名
 | ||||
| func (WtComment) TableName() string { | ||||
|   return "wt_comments" | ||||
| } | ||||
| 
 | ||||
|  | @ -0,0 +1,21 @@ | |||
| package wt | ||||
| 
 | ||||
| import ( | ||||
| 	"goweb-gin-demo/global" | ||||
| ) | ||||
| 
 | ||||
| // WtRule 结构体
 | ||||
| type WtRule struct { | ||||
|       global.GLOBAL_MODEL | ||||
|       UserId  int `json:"userId" form:"userId" gorm:"column:user_id;comment:用户id;type:bigint"` | ||||
|       Reporters  string `json:"reporters" form:"reporters" gorm:"column:reporters;comment:需要提交报告的人;type:varchar(500);"` | ||||
|       StartTime  string `json:"startTime" form:"startTime" gorm:"column:start_time;comment:提交报告的起始时间5-0900 代表周五9点;type:varchar(50);"` | ||||
|       EndTime  string `json:"endTime" form:"endTime" gorm:"column:end_time;comment:提交报告的结束时间8-0900 代表次周一9点截止;type:varchar(50);"` | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| // TableName WtRule 表名
 | ||||
| func (WtRule) TableName() string { | ||||
|   return "wt_rules" | ||||
| } | ||||
| 
 | ||||
|  | @ -1,4 +1,3 @@ | |||
| // 自动生成模板WtTemplate
 | ||||
| package wt | ||||
| 
 | ||||
| import ( | ||||
|  |  | |||
|  | @ -15,6 +15,7 @@ type RouterGroup struct { | |||
| 	web.AuthorityRouter | ||||
| 
 | ||||
| 	wt.WtReportsRouter | ||||
| 	wt.WtRuleRouter | ||||
| } | ||||
| 
 | ||||
| var RouterGroupApp = new(RouterGroup) | ||||
|  |  | |||
|  | @ -10,19 +10,19 @@ type WtReportsRouter struct { | |||
| } | ||||
| 
 | ||||
| 
 | ||||
| // InitWtReportsRouter 初始化 WtReports 路由信息
 | ||||
| // InitWtReportsRouter 初始化周报路由信息
 | ||||
| func (s *WtReportsRouter) InitWtReportsRouter(Router *gin.RouterGroup) { | ||||
| 	wtReportsRouter := Router.Group("wtReports").Use(middleware.OperationRecord()) | ||||
| 	wtReportsRouterWithoutRecord := Router.Group("wtReports") | ||||
| 	var wtReportsApi = api.ApiGroupApp.WtServiceGroup.WtReportsApi | ||||
| 	{ | ||||
| 		wtReportsRouter.POST("createWtReports", wtReportsApi.CreateWtReports)   // 新建WtReports
 | ||||
| 		wtReportsRouter.DELETE("deleteWtReportsByIds", wtReportsApi.DeleteWtReportsByIds) // 批量删除WtReports
 | ||||
| 		wtReportsRouter.PUT("updateWtReports", wtReportsApi.UpdateWtReports)    // 更新WtReports
 | ||||
| 		wtReportsRouter.POST("createWtReports", wtReportsApi.CreateWtReports)   // 新建周报
 | ||||
| 		wtReportsRouter.DELETE("deleteWtReportsByIds", wtReportsApi.DeleteWtReportsByIds) // 批量删除周报
 | ||||
| 		wtReportsRouter.PUT("updateWtReports", wtReportsApi.UpdateWtReports)    // 更新周报
 | ||||
| 	} | ||||
| 	{ | ||||
| 		wtReportsRouterWithoutRecord.GET("findWtReports", wtReportsApi.FindWtReports)        // 根据ID获取WtReports
 | ||||
| 		wtReportsRouterWithoutRecord.GET("getWtReportsList", wtReportsApi.GetWtReportsList)  // 获取WtReports列表
 | ||||
| 		wtReportsRouterWithoutRecord.GET("findWtReports", wtReportsApi.FindWtReports)        // 根据ID获取周报
 | ||||
| 		wtReportsRouterWithoutRecord.GET("getWtReportsList", wtReportsApi.GetWtReportsList)  // 获取周报列表
 | ||||
| 	} | ||||
| 
 | ||||
| 	wtTemplatesRouter := Router.Group("wtTemplates").Use(middleware.OperationRecord()) | ||||
|  | @ -37,4 +37,17 @@ func (s *WtReportsRouter) InitWtReportsRouter(Router *gin.RouterGroup) { | |||
| 		wtTemplatesRouterWithoutRecord.GET("findWtTemplate", wtTemplatesApi.FindWtTemplate)        // 根据ID获取周报模板
 | ||||
| 		wtTemplatesRouterWithoutRecord.GET("getWtTemplateList", wtTemplatesApi.GetWtTemplateList)  // 获取周报模板列表
 | ||||
| 	} | ||||
| 
 | ||||
| 	wtCommentRouter := Router.Group("wtComment").Use(middleware.OperationRecord()) | ||||
| 	wtCommentRouterWithoutRecord := Router.Group("wtComment") | ||||
| 	var wtCommentApi = api.ApiGroupApp.WtServiceGroup.WtCommentApi | ||||
| 	{ | ||||
| 		wtCommentRouter.POST("createWtComment", wtCommentApi.CreateWtComment)   // 新建周报评论
 | ||||
| 		wtCommentRouter.DELETE("deleteWtCommentByIds", wtCommentApi.DeleteWtCommentByIds) // 批量删除周报评论
 | ||||
| 		wtCommentRouter.PUT("updateWtComment", wtCommentApi.UpdateWtComment)    // 更新周报评论
 | ||||
| 	} | ||||
| 	{ | ||||
| 		wtCommentRouterWithoutRecord.GET("findWtComment", wtCommentApi.FindWtComment)        // 根据ID获取周报评论
 | ||||
| 		wtCommentRouterWithoutRecord.GET("getWtCommentList", wtCommentApi.GetWtCommentList)  // 获取周报评论列表
 | ||||
| 	} | ||||
| } | ||||
|  | @ -0,0 +1,26 @@ | |||
| package wt | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	"goweb-gin-demo/api" | ||||
| 	"goweb-gin-demo/middleware" | ||||
| ) | ||||
| 
 | ||||
| type WtRuleRouter struct { | ||||
| } | ||||
| 
 | ||||
| // InitWtRuleRouter 初始化 统计规则 路由信息
 | ||||
| func (s *WtRuleRouter) InitWtRuleRouter(Router *gin.RouterGroup) { | ||||
| 	wtRuleRouter := Router.Group("wtRule").Use(middleware.OperationRecord()) | ||||
| 	wtRuleRouterWithoutRecord := Router.Group("wtRule") | ||||
| 	var wtRuleApi = api.ApiGroupApp.WtServiceGroup.WtRuleApi | ||||
| 	{ | ||||
| 		wtRuleRouter.POST("createWtRule", wtRuleApi.CreateWtRule)   // 新建统计规则
 | ||||
| 		wtRuleRouter.DELETE("deleteWtRuleByIds", wtRuleApi.DeleteWtRuleByIds) // 批量删除统计规则
 | ||||
| 		wtRuleRouter.PUT("updateWtRule", wtRuleApi.UpdateWtRule)    // 更新统计规则
 | ||||
| 	} | ||||
| 	{ | ||||
| 		wtRuleRouterWithoutRecord.GET("findWtRule", wtRuleApi.FindWtRule)        // 根据ID获取统计规则
 | ||||
| 		wtRuleRouterWithoutRecord.GET("getWtRuleList", wtRuleApi.GetWtRuleList)  // 获取统计规则列表
 | ||||
| 	} | ||||
| } | ||||
|  | @ -1,20 +1,13 @@ | |||
| package service | ||||
| 
 | ||||
| import "goweb-gin-demo/service/wt" | ||||
| import ( | ||||
| 	"goweb-gin-demo/service/system" | ||||
| 	"goweb-gin-demo/service/wt" | ||||
| ) | ||||
| 
 | ||||
| type ServiceGroup struct { | ||||
| 	UserService | ||||
| 	JwtService | ||||
| 	CasbinService | ||||
| 	OperationRecordService | ||||
| 	MenuService | ||||
| 	BaseMenuService | ||||
| 	SystemConfigService | ||||
| 	FileUploadAndDownloadService | ||||
| 	AuthorityService | ||||
| 
 | ||||
| 	wt.WtReportsService | ||||
| 	wt.WtTemplateService | ||||
| 	SystemServiceGroup system.SystemServiceGroup | ||||
| 	WtServiceGroup     wt.WtServiceGroup | ||||
| } | ||||
| 
 | ||||
| var ServiceGroupApp = new(ServiceGroup) | ||||
|  |  | |||
|  | @ -1,14 +1,14 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
| 	"strconv" | ||||
| 
 | ||||
| 	"gorm.io/gorm" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/web" | ||||
| 	"goweb-gin-demo/model/web/response" | ||||
| 	"gorm.io/gorm" | ||||
| ) | ||||
| 
 | ||||
| //@author: [piexlmax](https://github.com/piexlmax)
 | ||||
|  | @ -1,11 +1,11 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
| 
 | ||||
| 	"gorm.io/gorm" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/web" | ||||
| 	"gorm.io/gorm" | ||||
| ) | ||||
| 
 | ||||
| type BaseMenuService struct { | ||||
|  | @ -1,4 +1,4 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
|  | @ -1,4 +1,4 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
|  | @ -0,0 +1,13 @@ | |||
| package system | ||||
| 
 | ||||
| type SystemServiceGroup struct { | ||||
| 	UserService | ||||
| 	JwtService | ||||
| 	CasbinService | ||||
| 	OperationRecordService | ||||
| 	MenuService | ||||
| 	BaseMenuService | ||||
| 	SystemConfigService | ||||
| 	FileUploadAndDownloadService | ||||
| 	AuthorityService | ||||
| } | ||||
|  | @ -1,4 +1,4 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
|  | @ -1,4 +1,4 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
|  | @ -1,13 +1,13 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
| 	"strconv" | ||||
| 
 | ||||
| 	"gorm.io/gorm" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/web" | ||||
| 	"gorm.io/gorm" | ||||
| ) | ||||
| 
 | ||||
| //@author: [piexlmax](https://github.com/piexlmax)
 | ||||
|  | @ -1,4 +1,4 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"goweb-gin-demo/global" | ||||
|  | @ -1,4 +1,4 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"go.uber.org/zap" | ||||
|  | @ -1,13 +1,13 @@ | |||
| package service | ||||
| package system | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
| 	uuid "github.com/satori/go.uuid" | ||||
| 	"gorm.io/gorm" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/web" | ||||
| 	"goweb-gin-demo/utils" | ||||
| 	"gorm.io/gorm" | ||||
| ) | ||||
| 
 | ||||
| //@author: [piexlmax](https://github.com/piexlmax)
 | ||||
|  | @ -1 +1,8 @@ | |||
| package wt | ||||
| 
 | ||||
| type WtServiceGroup struct { | ||||
| 	WtReportsService | ||||
| 	WtTemplateService | ||||
| 	WtCommentService | ||||
| 	WtRuleService | ||||
| } | ||||
|  | @ -0,0 +1,57 @@ | |||
| package wt | ||||
| 
 | ||||
| import ( | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/wt" | ||||
| 	wtReq "goweb-gin-demo/model/wt/request" | ||||
| ) | ||||
| 
 | ||||
| type WtCommentService struct { | ||||
| } | ||||
| 
 | ||||
| // CreateWtComment 创建WtComment记录
 | ||||
| func (wtCommentService *WtCommentService) CreateWtComment(wtComment wt.WtComment) (err error) { | ||||
| 	err = global.GLOBAL_DB.Create(&wtComment).Error | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // DeleteWtComment 删除WtComment记录
 | ||||
| func (wtCommentService *WtCommentService)DeleteWtComment(wtComment wt.WtComment) (err error) { | ||||
| 	err = global.GLOBAL_DB.Delete(&wtComment).Error | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // DeleteWtCommentByIds 批量删除WtComment记录
 | ||||
| func (wtCommentService *WtCommentService)DeleteWtCommentByIds(ids request.IdsReq) (err error) { | ||||
| 	err = global.GLOBAL_DB.Delete(&[]wt.WtComment{},"id in ?",ids.Ids).Error | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // UpdateWtComment 更新WtComment记录
 | ||||
| func (wtCommentService *WtCommentService)UpdateWtComment(wtComment wt.WtComment) (err error) { | ||||
| 	err = global.GLOBAL_DB.Save(&wtComment).Error | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // GetWtComment 根据id获取WtComment记录
 | ||||
| func (wtCommentService *WtCommentService)GetWtComment(id uint) (err error, wtComment wt.WtComment) { | ||||
| 	err = global.GLOBAL_DB.Where("id = ?", id).First(&wtComment).Error | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // GetWtCommentInfoList 分页获取WtComment记录
 | ||||
| func (wtCommentService *WtCommentService)GetWtCommentInfoList(info wtReq.WtCommentSearch) (err error, list interface{}, total int64) { | ||||
| 	limit := info.PageSize | ||||
| 	offset := info.PageSize * (info.Page - 1) | ||||
|     // 创建db
 | ||||
| 	db := global.GLOBAL_DB.Model(&wt.WtComment{}) | ||||
|     var wtComments []wt.WtComment | ||||
|     // 如果有条件搜索 下方会自动创建搜索语句
 | ||||
| 	err = db.Count(&total).Error | ||||
| 	if err!=nil { | ||||
|     	return | ||||
|     } | ||||
| 	err = db.Limit(limit).Offset(offset).Find(&wtComments).Error | ||||
| 	return err, wtComments, total | ||||
| } | ||||
|  | @ -0,0 +1,94 @@ | |||
| package wt | ||||
| 
 | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"goweb-gin-demo/global" | ||||
| 	"goweb-gin-demo/model/common/request" | ||||
| 	"goweb-gin-demo/model/wt" | ||||
| 	wtReq "goweb-gin-demo/model/wt/request" | ||||
| 	wtRes "goweb-gin-demo/model/wt/response" | ||||
| ) | ||||
| 
 | ||||
| type WtRuleService struct { | ||||
| } | ||||
| 
 | ||||
| // CreateWtRule 创建WtRule记录
 | ||||
| func (wtRuleService *WtRuleService) CreateWtRule(ruleRes wtReq.WtRuleRes) (err error) { | ||||
| 	rule := voToRule(ruleRes) | ||||
| 	err = global.GLOBAL_DB.Create(&rule).Error | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // DeleteWtRuleByIds 批量删除WtRule记录
 | ||||
| func (wtRuleService *WtRuleService) DeleteWtRuleByIds(ids request.IdsReq) (err error) { | ||||
| 	err = global.GLOBAL_DB.Delete(&[]wt.WtRule{}, "id in ?", ids.Ids).Error | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // UpdateWtRule 更新WtRule记录
 | ||||
| func (wtRuleService *WtRuleService) UpdateWtRule(ruleRes wtReq.WtRuleRes) (err error) { | ||||
| 	rule := voToRule(ruleRes) | ||||
| 	err = global.GLOBAL_DB.Updates(&rule).Error | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // GetWtRule 根据id获取WtRule记录
 | ||||
| func (wtRuleService *WtRuleService) GetWtRule(id uint) (err error, wtRule wt.WtRule) { | ||||
| 	err = global.GLOBAL_DB.Where("id = ?", id).First(&wtRule).Error | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // GetWtRuleInfoList 分页获取WtRule记录
 | ||||
| func (wtRuleService *WtRuleService) GetWtRuleInfoList(info wtReq.WtRuleSearch) (err error, list interface{}, total int64) { | ||||
| 	limit := info.PageSize | ||||
| 	offset := info.PageSize * (info.Page - 1) | ||||
| 	// 创建db
 | ||||
| 	db := global.GLOBAL_DB.Model(&wt.WtRule{}) | ||||
| 	var wtRules []wt.WtRule | ||||
| 	// 如果有条件搜索 下方会自动创建搜索语句
 | ||||
| 	err = db.Count(&total).Error | ||||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 	err = db.Limit(limit).Offset(offset).Find(&wtRules).Error | ||||
| 
 | ||||
| 	ruleResults := rulesToVOs(wtRules) | ||||
| 
 | ||||
| 	return err, ruleResults, total | ||||
| } | ||||
| 
 | ||||
| //数据转换一下, 需要把json数据转换为字符串
 | ||||
| func voToRule(ruleRes wtReq.WtRuleRes) wt.WtRule { | ||||
| 	contentJson, _ := json.Marshal(ruleRes.Reporters) | ||||
| 
 | ||||
| 	rule := wt.WtRule{ | ||||
| 		GLOBAL_MODEL: global.GLOBAL_MODEL{ID: ruleRes.ID}, | ||||
| 		UserId:       ruleRes.UserId, | ||||
| 		Reporters:    string(contentJson), | ||||
| 		StartTime:    ruleRes.StartTime, | ||||
| 		EndTime:      ruleRes.EndTime, | ||||
| 	} | ||||
| 	return rule | ||||
| } | ||||
| 
 | ||||
| // 批量转换 数据转换, 把字符串转换为json
 | ||||
| func rulesToVOs(rules []wt.WtRule) []wtRes.WtRuleResult { | ||||
| 	var ruleResults []wtRes.WtRuleResult | ||||
| 	for _, rule := range rules { | ||||
| 		ruleResult := ruleToResult(rule) | ||||
| 		ruleResults = append(ruleResults, ruleResult) | ||||
| 	} | ||||
| 	return ruleResults | ||||
| } | ||||
| 
 | ||||
| //单个转换
 | ||||
| func ruleToResult(rule wt.WtRule) wtRes.WtRuleResult { | ||||
| 	ruleResult := wtRes.WtRuleResult{} | ||||
| 	ruleResult.GLOBAL_MODEL = rule.GLOBAL_MODEL | ||||
| 	ruleResult.UserId = rule.UserId | ||||
| 	ruleResult.StartTime = rule.StartTime | ||||
| 	ruleResult.EndTime = rule.EndTime | ||||
| 
 | ||||
| 	json.Unmarshal([]byte(rule.Reporters), &ruleResult.Reporters) | ||||
| 	return ruleResult | ||||
| } | ||||
		Loading…
	
		Reference in New Issue