forked from all_user/stat_center
Initial commit
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package userinviteapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"stat/api/proto"
|
||||
"stat/common/log"
|
||||
"stat/common/stdLog"
|
||||
"stat/service/userinviteser"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// @Tags 全民代理
|
||||
// @Summary 全民代理
|
||||
// @Description 传入用户信息登录
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body proto.AdminLoginReq true "参数"
|
||||
// @Success 200 {string} string "成功"
|
||||
// @Success 400 {string} string "失败"
|
||||
// @Router /userInvite/district [POST]
|
||||
func UserDistictInfo(ctx *gin.Context) {
|
||||
param := proto.UserDistrictReq{}
|
||||
if err := ctx.ShouldBindJSON(¶m); err != nil {
|
||||
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data, err := userinviteser.UserDistictInfo(ctx, param)
|
||||
if err != nil {
|
||||
stdLog.ServerJSON(ctx, stdLog.Failure, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("district info", log.Any("request", param), log.Any("resp", data))
|
||||
|
||||
ctx.JSON(http.StatusOK, data)
|
||||
}
|
||||
|
||||
// @Tags 全民代理
|
||||
// @Summary 全民代理
|
||||
// @Description 传入用户信息登录
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body proto.AdminLoginReq true "参数"
|
||||
// @Success 200 {string} string "成功"
|
||||
// @Success 400 {string} string "失败"
|
||||
// @Router /user/districtcode [POST]
|
||||
func UserDistrictCode(ctx *gin.Context) {
|
||||
param := proto.UserDistrictCodeReq{}
|
||||
if err := ctx.ShouldBindJSON(¶m); err != nil {
|
||||
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data, err := userinviteser.UserDistrictCodeInfo(ctx, param)
|
||||
if err != nil {
|
||||
stdLog.ServerJSON(ctx, stdLog.Failure, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("district info", log.Any("request", param), log.Any("resp", data))
|
||||
|
||||
ctx.JSON(http.StatusOK, data)
|
||||
}
|
||||
Reference in New Issue
Block a user