diff --git a/goctl_template/api/etc.tpl b/goctl_template/api/etc.tpl index cf7aee4b..d2c383f3 100644 --- a/goctl_template/api/etc.tpl +++ b/goctl_template/api/etc.tpl @@ -2,3 +2,7 @@ Name: {{.serviceName}} Host: {{.host}} Port: {{.port}} SourceMysql: "" +Auth: + AccessSecret: fusen2023 + AccessExpire: 604800 + RefreshAfter: 345600 \ No newline at end of file diff --git a/server/home-user-auth/internal/types/types.go b/server/home-user-auth/internal/types/types.go index c964fefc..1a2a01a2 100644 --- a/server/home-user-auth/internal/types/types.go +++ b/server/home-user-auth/internal/types/types.go @@ -2,7 +2,7 @@ package types import ( - "fusenapi/utils/basic" + ) type Request struct { @@ -125,43 +125,4 @@ type Auth struct { AccessExpire int64 `json:"accessExpire"` RefreshAfter int64 `json:"refreshAfter"` } - -// Set 设置Response的Code和Message值 -func (resp *Response) Set(Code int, Message string) *Response { - return &Response{ - Code: Code, - Message: Message, - } -} - -// Set 设置整个Response -func (resp *Response) SetWithData(Code int, Message string, Data interface{}) *Response { - return &Response{ - Code: Code, - Message: Message, - Data: Data, - } -} - -// SetStatus 设置默认StatusResponse(内部自定义) 默认msg, 可以带data, data只使用一个参数 -func (resp *Response) SetStatus(sr *basic.StatusResponse, data ...interface{}) *Response { - newResp := &Response{ - Code: sr.Code, - } - if len(data) == 1 { - newResp.Data = data[0] - } - return newResp -} - -// SetStatusWithMessage 设置默认StatusResponse(内部自定义) 非默认msg, 可以带data, data只使用一个参数 -func (resp *Response) SetStatusWithMessage(sr *basic.StatusResponse, msg string, data ...interface{}) *Response { - newResp := &Response{ - Code: sr.Code, - Message: msg, - } - if len(data) == 1 { - newResp.Data = data[0] - } - return newResp -} + \ No newline at end of file