Merge branch 'main' of http://1.117.67.95:3000/team/bdqr-server
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"bdqr-server/app/main/api/internal/logic/agent"
|
||||
"bdqr-server/app/main/api/internal/svc"
|
||||
"bdqr-server/app/main/api/internal/types"
|
||||
"bdqr-server/common/result"
|
||||
"bdqr-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetInvitePosterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetInvitePosterReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := agent.NewGetInvitePosterLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetInvitePoster(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -676,6 +676,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
Path: "/invite_link",
|
||||
Handler: agent.GetInviteLinkHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/invite/poster",
|
||||
Handler: agent.GetInvitePosterHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/level/privilege",
|
||||
|
||||
Reference in New Issue
Block a user