项目目录优化,任务模块后端代码

This commit is contained in:
PandaGoAdmin
2021-12-23 17:23:27 +08:00
parent 0caf81660c
commit 21ff92a93c
67 changed files with 802 additions and 206 deletions

View File

@@ -0,0 +1,42 @@
package router
import (
"github.com/gin-gonic/gin"
api2 "pandax/apps/system/api"
services2 "pandax/apps/system/services"
"pandax/base/ctx"
)
func InitPostRouter(router *gin.RouterGroup) {
s := &api2.PostApi{
PostApp: services2.SysPostModelDao,
UserApp: services2.SysUserModelDao,
RoleApp: services2.SysRoleModelDao,
}
post := router.Group("post")
postList := ctx.NewLogInfo("获取岗位分页列表")
post.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(postList).Handle(s.GetPostList)
})
postLog := ctx.NewLogInfo("获取岗位信息")
post.GET(":postId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(postLog).Handle(s.GetPost)
})
insertPostLog := ctx.NewLogInfo("添加岗位信息")
post.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertPostLog).Handle(s.InsertPost)
})
updatePostLog := ctx.NewLogInfo("修改岗位信息")
post.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updatePostLog).Handle(s.UpdatePost)
})
deletePostLog := ctx.NewLogInfo("删除岗位信息")
post.DELETE(":postId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deletePostLog).Handle(s.DeletePost)
})
}