This commit is contained in:
XM-GO
2023-08-22 17:29:11 +08:00
parent 5be575e982
commit 3ac5ecc55a
20 changed files with 88 additions and 128 deletions

View File

@@ -28,10 +28,6 @@ func (p *PostApi) GetPostList(rc *restfulx.ReqCtx) {
postCode := restfulx.QueryParam(rc, "postCode")
post := entity.SysPost{Status: status, PostName: postName, PostCode: postCode}
if !IsTenantAdmin(rc.LoginAccount.TenantId) {
post.TenantId = rc.LoginAccount.TenantId
}
list, total := p.PostApp.FindListPage(pageNum, pageSize, post)
rc.ResData = model.ResultPage{
@@ -51,8 +47,7 @@ func (p *PostApi) GetPost(rc *restfulx.ReqCtx) {
// InsertPost 添加职位
func (p *PostApi) InsertPost(rc *restfulx.ReqCtx) {
var post entity.SysPost
restfulx.BindQuery(rc, &post)
post.TenantId = rc.LoginAccount.TenantId
restfulx.BindJsonAndValid(rc, &post)
post.CreateBy = rc.LoginAccount.UserName
p.PostApp.Insert(post)
}
@@ -60,7 +55,7 @@ func (p *PostApi) InsertPost(rc *restfulx.ReqCtx) {
// UpdatePost 修改职位
func (p *PostApi) UpdatePost(rc *restfulx.ReqCtx) {
var post entity.SysPost
restfulx.BindQuery(rc, &post)
restfulx.BindJsonAndValid(rc, &post)
post.CreateBy = rc.LoginAccount.UserName
p.PostApp.Update(post)