大面积重构
Response部分 usersController部分 中间件部分
This commit is contained in:
20
pkg/service/controller/usersController.go
Normal file
20
pkg/service/controller/usersController.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"drive-linked/pkg/service"
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
func UserProfile(ctx iris.Context) {
|
||||
serv := service.NewUsersService(ctx)
|
||||
|
||||
// 获取所有查询条件参数
|
||||
var conditions map[string]interface{}
|
||||
for _, field := range service.UserConditions {
|
||||
if ctx.Params().GetString(field) != "" {
|
||||
conditions[field] = ctx.Params().GetString(field)
|
||||
}
|
||||
}
|
||||
serv.GetOneUser(&conditions)
|
||||
ctx.Next()
|
||||
}
|
||||
Reference in New Issue
Block a user