app
This commit is contained in:
19
services/app.go
Normal file
19
services/app.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-print/dao"
|
||||
"git.rosy.net.cn/jx-print/globals"
|
||||
"git.rosy.net.cn/jx-print/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func GetApps(c *gin.Context, user *model.User) (apps []*model.Apps, err error) {
|
||||
if user == nil {
|
||||
return nil, fmt.Errorf("未获取到账号信息!")
|
||||
}
|
||||
if user.UserID == "" {
|
||||
return nil, fmt.Errorf("账号信息有误,请重新登录!")
|
||||
}
|
||||
return dao.GetApps(globals.GetDB(), user.UserID)
|
||||
}
|
||||
Reference in New Issue
Block a user