q!
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Name: wetset
|
||||
Name: webset
|
||||
Host: 0.0.0.0
|
||||
Port: 8888
|
||||
Port: 9914
|
||||
SourceMysql: "fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest"
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
AccessExpire: 604800
|
||||
RefreshAfter: 345600
|
||||
AccessExpire: 2592000
|
||||
RefreshAfter: 1592000
|
||||
@@ -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{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package wetset_test
|
||||
package webset_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package wetset_test
|
||||
package webset_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
var configFile = flag.String("f", "etc/wetset.yaml", "the config file")
|
||||
var configFile = flag.String("f", "etc/webset.yaml", "the config file")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
Reference in New Issue
Block a user