This commit is contained in:
XM-GO
2023-04-13 16:39:15 +08:00
parent 078781a240
commit c0d90c080e
12 changed files with 391 additions and 125 deletions

View File

@@ -8,6 +8,7 @@ package api
import (
"github.com/XM-GO/PandaKit/model"
"github.com/XM-GO/PandaKit/restfulx"
"github.com/kakuilan/kgo"
"strings"
"pandax/apps/visual/entity"
@@ -26,6 +27,8 @@ func (p *VisualScreenApi) GetVisualScreenList(rc *restfulx.ReqCtx) {
data.ScreenName = restfulx.QueryParam(rc, "screenName")
data.Status = restfulx.QueryParam(rc, "status")
data.GroupId = int64(restfulx.QueryInt(rc, "groupId", 0))
list, total := p.VisualScreenApp.FindListPage(pageNum, pageSize, data)
rc.ResData = model.ResultPage{
@@ -46,7 +49,9 @@ func (p *VisualScreenApi) GetVisualScreen(rc *restfulx.ReqCtx) {
func (p *VisualScreenApi) InsertVisualScreen(rc *restfulx.ReqCtx) {
var data entity.VisualScreen
restfulx.BindQuery(rc, &data)
data.UserId = rc.LoginAccount.UserId
data.ScreenId = kgo.KStr.Uniqid("px")
data.Creator = rc.LoginAccount.UserName
p.VisualScreenApp.Insert(data)
}
@@ -64,3 +69,10 @@ func (p *VisualScreenApi) DeleteVisualScreen(rc *restfulx.ReqCtx) {
screenIds := strings.Split(screenId, ",")
p.VisualScreenApp.Delete(screenIds)
}
// UpdateScreenStatus 修改状态
func (p *VisualScreenApi) UpdateScreenStatus(rc *restfulx.ReqCtx) {
var screen entity.VisualScreen
restfulx.BindQuery(rc, &screen)
p.VisualScreenApp.Update(screen)
}