增加社区列表接口,任务相关接口修改
This commit is contained in:
22
internal/handler/task/get_community_list_handler.go
Normal file
22
internal/handler/task/get_community_list_handler.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"nova_task/internal/logic/task"
|
||||
"nova_task/internal/svc"
|
||||
)
|
||||
|
||||
// 获取社区列表
|
||||
func GetCommunityListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := task.NewGetCommunityListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetCommunityList()
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
// 校验任务结果
|
||||
func VerifyTaskResultHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.TaskIdPath
|
||||
var req types.VerifyTaskResultReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user