28 lines
646 B
Go
28 lines
646 B
Go
package carv
|
|
|
|
import (
|
|
"net/http"
|
|
"nova_task/internal/pkg/errs"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
"nova_task/internal/logic/carv"
|
|
"nova_task/internal/svc"
|
|
"nova_task/internal/types"
|
|
)
|
|
|
|
// 下载并绑定Castile游戏角色
|
|
func DownloadAndBindRoleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
var req types.EmailKey
|
|
ctx := r.Context()
|
|
if err := httpx.Parse(r, &req); err != nil {
|
|
httpx.ErrorCtx(ctx, w, err)
|
|
return
|
|
}
|
|
|
|
l := carv.NewDownloadAndBindRoleLogic(ctx, svcCtx)
|
|
resp := l.DownloadAndBindRole(&req)
|
|
errs.WriteHttpResponse(ctx, w, resp)
|
|
}
|
|
}
|