Migrate all methods in the model package to the service package

This commit is contained in:
Granty1
2020-04-08 11:07:27 +08:00
parent 2c35adaffc
commit 5d222585dd
49 changed files with 1348 additions and 1261 deletions
+12
View File
@@ -0,0 +1,12 @@
package request
// Paging common input parameter structure
type PageInfo struct {
Page int `json:"page"`
PageSize int `json:"pageSize"`
}
// Find by id structure
type GetById struct {
Id float64 `json:"id"`
}
+15
View File
@@ -0,0 +1,15 @@
package request
import (
"github.com/dgrijalva/jwt-go"
uuid "github.com/satori/go.uuid"
)
// Custom claims structure
type CustomClaims struct {
UUID uuid.UUID
ID uint
NickName string
AuthorityId string
jwt.StandardClaims
}
+11
View File
@@ -0,0 +1,11 @@
package request
import "gin-vue-admin/model"
//api分页条件查询及排序结构体
type SearchApiParams struct {
model.SysApi
PageInfo
OrderKey string `json:"orderKey"`
Desc bool `json:"desc"`
}
+13
View File
@@ -0,0 +1,13 @@
package request
// Casbin info structure
type CasbinInfo struct {
Path string `json:"path"`
Method string `json:"method"`
}
// Casbin structure for input parameters
type CasbinInReceive struct {
AuthorityId string `json:"authorityId"`
CasbinInfos []CasbinInfo `json:"casbinInfos"`
}
+14
View File
@@ -0,0 +1,14 @@
package request
import "gin-vue-admin/model"
// Add menu authority info structure
type AddMenuAuthorityInfo struct {
Menus []model.SysBaseMenu
AuthorityId string
}
// Get role by id structure
type AuthorityIdInfo struct {
AuthorityId string
}
+33
View File
@@ -0,0 +1,33 @@
package request
import uuid "github.com/satori/go.uuid"
// User register structure
type RegisterStruct struct {
Username string `json:"userName"`
Password string `json:"passWord"`
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"`
AuthorityId string `json:"authorityId" gorm:"default:888"`
}
// User login structure
type RegisterAndLoginStruct struct {
Username string `json:"username"`
Password string `json:"password"`
Captcha string `json:"captcha"`
CaptchaId string `json:"captchaId"`
}
// Modify password structure
type ChangePasswordStruct struct {
Username string `json:"username"`
Password string `json:"password"`
NewPassword string `json:"newPassword"`
}
// Modify user's auth structure
type SetUserAuth struct {
UUID uuid.UUID `json:"uuid"`
AuthorityId string `json:"authorityId"`
}