This commit is contained in:
2026-08-14 12:13:02 +08:00
parent 0e62930c64
commit 285fa01471
71 changed files with 1805 additions and 746 deletions
+34
View File
@@ -0,0 +1,34 @@
package controller
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"36wisdom/biz/model/dto"
"36wisdom/biz/service"
)
type adminUser struct{}
var AdminUser = &adminUser{}
func (c *adminUser) Get(ctx context.Context, req *dto.AdminUserGetReq) (*dto.AdminUserGetRes, error) {
rec, err := service.AdminUser.GetByUsername(ctx, req.Username)
if err != nil {
return nil, err
}
res := &dto.AdminUserGetRes{}
if !rec.IsEmpty() {
res.AdminUser = adminUserItem(rec)
}
return res, nil
}
func adminUserItem(r gdb.Record) dto.AdminUserItem {
return dto.AdminUserItem{
Id: r["id"].Int64(),
Username: r["username"].String(),
Status: r["status"].Int(),
}
}