q!
This commit is contained in:
@@ -15,7 +15,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/web-set/setting",
|
||||
Handler: WetSetSettingHandler(serverCtx),
|
||||
Handler: WebSetSettingHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"fusenapi/server/webset/internal/types"
|
||||
)
|
||||
|
||||
func WetSetSettingHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func WebSetSettingHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
var (
|
||||
@@ -65,7 +65,7 @@ func WetSetSettingHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
// 创建一个业务逻辑层实例
|
||||
l := logic.NewWetSetSettingLogic(r.Context(), svcCtx)
|
||||
resp := l.WetSetSetting(&req, userinfo)
|
||||
resp := l.WebSetSetting(&req, userinfo)
|
||||
// 如果响应不为nil,则使用httpx.OkJsonCtx方法返回JSON响应;
|
||||
if resp != nil {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
@@ -29,7 +29,7 @@ func NewWetSetSettingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Wet
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WetSetSettingLogic) WetSetSetting(req *types.RequestWebSet, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||
func (l *WetSetSettingLogic) WebSetSetting(req *types.RequestWebSet, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||
// userinfo 传入值时, 一定不为null
|
||||
|
||||
@@ -9,7 +9,7 @@ type RequestWebSet struct {
|
||||
Type string `form:"type"`
|
||||
}
|
||||
|
||||
type DataWetSet struct {
|
||||
type DataWebSet struct {
|
||||
Title string `json:"title"`
|
||||
Introduction string `json:"introduction"`
|
||||
List interface{} `json:"list"`
|
||||
@@ -30,6 +30,20 @@ type Auth struct {
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
|
||||
type File struct {
|
||||
Filename string `fsfile:"filename"`
|
||||
Header map[string][]string `fsfile:"header"`
|
||||
Size int64 `fsfile:"size"`
|
||||
Data []byte `fsfile:"data"`
|
||||
}
|
||||
|
||||
type Meta struct {
|
||||
TotalCount int64 `json:"totalCount"`
|
||||
PageCount int64 `json:"pageCount"`
|
||||
CurrentPage int `json:"currentPage"`
|
||||
PerPage int `json:"perPage"`
|
||||
}
|
||||
|
||||
// Set 设置Response的Code和Message值
|
||||
func (resp *Response) Set(Code int, Message string) *Response {
|
||||
return &Response{
|
||||
|
||||
Reference in New Issue
Block a user