You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
Go
39 lines
1.0 KiB
Go
1 year ago
|
package district
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"git.noahlan.cn/noahlan/ntool-biz/zero/statusz"
|
||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||
|
|
||
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/logic/district"
|
||
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/svc"
|
||
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/types"
|
||
|
)
|
||
|
|
||
|
// swagger:route get /api/district/children district GetDistrictChildren
|
||
|
//
|
||
|
// get district children | 获取子级地址列表
|
||
|
//
|
||
|
// get district children | 获取子级地址列表
|
||
|
//
|
||
|
// Responses:
|
||
|
// 200: []*DistrictInfo
|
||
|
|
||
|
func GetDistrictChildrenHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||
|
const transErr = true
|
||
|
var req types.GetDistrictChildrenReq
|
||
|
if err := httpx.Parse(r, &req); err != nil {
|
||
|
statusz.ResponseHandler(r, w, transErr, nil, err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
l := district.NewGetDistrictChildrenLogic(r, r.Context(), svcCtx)
|
||
|
resp, err := l.GetDistrictChildren(&req)
|
||
|
|
||
|
statusz.ResponseHandler(r, w, transErr, resp, err)
|
||
|
|
||
|
}
|
||
|
}
|