This commit is contained in:
aozhiwei 2024-04-29 14:42:31 +08:00
parent 2f893164ca
commit 3309d098cd
7 changed files with 69 additions and 3 deletions

View File

@ -70,6 +70,7 @@ CREATE TABLE `t_group` (
`group_id` bigint NOT NULL COMMENT 'group id',
`group_name` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '分组名',
`group_desc` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '描述',
`enabled` int(11) NOT NULL DEFAULT '0' COMMENT '是否已启用',
`deleted` int(11) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',

View File

@ -23,8 +23,8 @@ exports.RspHead = class RspHead {
constructor() {
this.fields = [
['errcode', 0, '错误码/0 成功1 失败'],
['errmsg', '', '错误描述'],
['code', 0, '错误码/0 成功1 失败'],
['message', '', '错误描述'],
];
}
@ -51,3 +51,19 @@ exports.Mail = class RspHead {
}
};
exports.UserGroup = class RspHead {
constructor() {
this.fields = [
['group_id', '', '组id'],
['group_name', '', '组名'],
['group_desc', '', '描述'],
['enabled', 0, '是否已启用'],
['deleted', 0, '是否已删除'],
['createtime', 0, '创建时间'],
['modifytime', 0, '修改时间'],
];
}
};

View File

@ -17,7 +17,7 @@ module.exports = class {
],
'response': [
new common.RspHead(),
['!mail_list', common.Mail()]
['!data', common.Mail()]
]
},

View File

@ -6,5 +6,6 @@ type ApiGroup struct {
AuditApi
EmailApi
MailApi
UserGroupApi
BattleServerApi
}

View File

@ -0,0 +1,14 @@
package system
import (
"github.com/gin-gonic/gin"
)
type UserGroupApi struct {
}
func (this *UserGroupApi) List(c *gin.Context) {
}
func (this *UserGroupApi) Add(c *gin.Context) {
}

View File

@ -0,0 +1,15 @@
package system
type Group struct {
GroupId int64 `gorm:"unique;column:group_id" json:"group_id"`
GroupName string `gorm:"unique;column:group_name" json:"group_name"`
GroupDesc string `gorm:"column:group_desc" json:"group_desc"`
Enabled int32 `gorm:"unique;column:enabled" json:"enabled"`
Deleted int32 `gorm:"unique;column:deleted" json:"deleted"`
CreateTime int32 `gorm:"unique;column:createtime" json:"createtime"`
ModifyTime int32 `gorm:"unique;column:modifytime" json:"modifytime"`
}
func (Group) TableName() string {
return "t_group"
}

View File

@ -0,0 +1,19 @@
package system
import (
"github.com/gin-gonic/gin"
"main/api/v1"
)
type UserGroupRoute struct{
}
func (this *UserGroupRoute) InitMailRouter(priRouter *gin.RouterGroup) {
group := priRouter.Group("user_group")
api := v1.ApiGroupApp.SystemApiGroup.UserGroupApi
{
group.POST("add", api.Add)
group.GET("list", api.List)
}
}