mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package router
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"pandax/apps/system/api"
|
|
"pandax/apps/system/services"
|
|
"pandax/base/ctx"
|
|
)
|
|
|
|
func InitPostRouter(router *gin.RouterGroup) {
|
|
s := &api.PostApi{
|
|
PostApp: services.SysPostModelDao,
|
|
UserApp: services.SysUserModelDao,
|
|
RoleApp: services.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)
|
|
})
|
|
}
|