This commit is contained in:
aozhiwei 2024-04-29 14:49:50 +08:00
parent 9a89494deb
commit 59b31a0d6d
3 changed files with 22 additions and 12 deletions

View File

@ -11,6 +11,15 @@ import (
type MailApi struct { type MailApi struct {
} }
func (this *MailApi) ListMail(c *gin.Context) {
mails := []system.Mail{}
f5.GetApp().GetOrmDb(constant.MAIL_DB).Find(&mails)
c.JSON(http.StatusOK, gin.H{
"code": 0,
"message": "",
"data": mails,
})
}
func (this *MailApi) AddMail(c *gin.Context) { func (this *MailApi) AddMail(c *gin.Context) {
reqJson := struct { reqJson := struct {
@ -58,13 +67,3 @@ func (this *MailApi) AddMail(c *gin.Context) {
"message": "", "message": "",
}) })
} }
func (this *MailApi) ListMail(c *gin.Context) {
mails := []system.Mail{}
f5.GetApp().GetOrmDb(constant.MAIL_DB).Find(&mails)
c.JSON(http.StatusOK, gin.H{
"code": 0,
"message": "",
"data": mails,
})
}

View File

@ -1,6 +1,10 @@
package system package system
import ( import (
"f5"
"net/http"
"main/constant"
"main/model/system"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -8,6 +12,13 @@ type UserGroupApi struct {
} }
func (this *UserGroupApi) List(c *gin.Context) { func (this *UserGroupApi) List(c *gin.Context) {
groups := []system.UserGroup{}
f5.GetApp().GetOrmDb(constant.MAIL_DB).Find(&groups)
c.JSON(http.StatusOK, gin.H{
"code": 0,
"message": "",
"data": groups,
})
} }
func (this *UserGroupApi) Add(c *gin.Context) { func (this *UserGroupApi) Add(c *gin.Context) {

View File

@ -1,6 +1,6 @@
package system package system
type Group struct { type UserGroup struct {
GroupId int64 `gorm:"unique;column:group_id" json:"group_id"` GroupId int64 `gorm:"unique;column:group_id" json:"group_id"`
GroupName string `gorm:"unique;column:group_name" json:"group_name"` GroupName string `gorm:"unique;column:group_name" json:"group_name"`
GroupDesc string `gorm:"column:group_desc" json:"group_desc"` GroupDesc string `gorm:"column:group_desc" json:"group_desc"`
@ -10,6 +10,6 @@ type Group struct {
ModifyTime int32 `gorm:"unique;column:modifytime" json:"modifytime"` ModifyTime int32 `gorm:"unique;column:modifytime" json:"modifytime"`
} }
func (Group) TableName() string { func (UserGroup) TableName() string {
return "t_group" return "t_group"
} }