rename
This commit is contained in:
parent
d1d8c89976
commit
5421ae8a87
|
|
@ -34,7 +34,7 @@ var defaultHeadImgUrl = "http://" + web.CONFIG.System.Addr + "/static/img/202403
|
|||
// 登录
|
||||
func (p DefParty) login() web_iris.Party {
|
||||
return web_iris.Party{
|
||||
Perfix: p.Prefix,
|
||||
Prefix: p.Prefix,
|
||||
PartyFunc: func(index iris.Party) {
|
||||
index.Post(AuthBase+"/login", func(ctx *context.Context) {
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
@ -103,7 +103,7 @@ type GetUserInfoResponse struct {
|
|||
|
||||
// 获取用户信息
|
||||
func (p DefParty) getUserInfo() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(AuthBase+"/getUserInfo", func(ctx *context.Context) {
|
||||
headerInfo := GetHeaderBaseInfo(ctx)
|
||||
var userInfo *models.User
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ type GoodsListResponse struct {
|
|||
|
||||
// 商品列表
|
||||
func (p DefParty) goodsList() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(GoodsBase+"/goodsList", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
@ -90,7 +90,7 @@ func getPetGoodsList(key string) []GoodsDetail {
|
|||
|
||||
// 商品详情
|
||||
func (p DefParty) goodsDetail() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(GoodsBase+"/goodsDetail", func(ctx *context.Context) {
|
||||
//暂留
|
||||
Success(ctx, nil, nil)
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ func FrontAuth(ctx *context.Context) {
|
|||
}
|
||||
|
||||
func (p DefParty) index() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Get("/", func(c *context.Context) {
|
||||
_, _ = c.WriteString("successful")
|
||||
})
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ type OrderCreateResponse struct {
|
|||
|
||||
// 创建
|
||||
func (p DefParty) orderCreate() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(OrderBase+"/orderCreate", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
@ -159,7 +159,7 @@ type OrderListResponse struct {
|
|||
|
||||
// 订单列表
|
||||
func (p DefParty) orderList() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(OrderBase+"/orderList", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
@ -223,7 +223,7 @@ func (p DefParty) orderList() web_iris.Party {
|
|||
|
||||
// 获取订单可预约时间
|
||||
func (p DefParty) orderServiceTime() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(OrderBase+"/orderServiceTime", func(ctx *context.Context) {
|
||||
|
||||
})
|
||||
|
|
@ -232,7 +232,7 @@ func (p DefParty) orderServiceTime() web_iris.Party {
|
|||
|
||||
// 支付
|
||||
func (p DefParty) orderPay() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(OrderBase+"/orderPay", func(ctx *context.Context) {
|
||||
|
||||
})
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ type PetListResponse struct {
|
|||
|
||||
// 宠物列表
|
||||
func (p DefParty) petList() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(PetBase+"/petList", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
userPets := GetUserPets(headerBaseInfo.Uid)
|
||||
|
|
@ -59,7 +59,7 @@ type PetInfoResponse struct {
|
|||
}
|
||||
|
||||
func (p DefParty) petInfo() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(PetBase+"/petInfo", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
@ -90,7 +90,7 @@ type PetAddOrEditResponse struct {
|
|||
|
||||
// 宠物添加或编辑
|
||||
func (p DefParty) petAddOrEdit() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(PetBase+"/petAddOrEdit", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
@ -147,7 +147,7 @@ type PetTypeListResponse struct {
|
|||
|
||||
// 宠物基础信息列表
|
||||
func (p DefParty) petTypeList() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(PetBase+"/petTypeList", func(ctx *context.Context) {
|
||||
var petBaseInfoList []models.PetBaseInfo
|
||||
for _, petBaseInfo := range PetBaseInfoMap {
|
||||
|
|
@ -163,7 +163,7 @@ type DelPetRequest struct {
|
|||
}
|
||||
|
||||
func (p DefParty) delPet() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(PetBase+"/delPet", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ type ServiceAddrListResponse struct {
|
|||
|
||||
// 我的服务地址列表
|
||||
func (p DefParty) serviceAddrList() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(ServiceBase+"/serviceAddrList", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
var userServiceAddrList []*models.UserServiceAddr
|
||||
|
|
@ -50,7 +50,7 @@ type ServiceAddOrEditResponse struct {
|
|||
|
||||
// 服务地址添加或编辑
|
||||
func (p DefParty) serviceAddOrEdit() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(ServiceBase+"/serviceAddOrEdit", func(ctx *context.Context) {
|
||||
headerBaseInfo := GetHeaderBaseInfo(ctx)
|
||||
body, _ := io.ReadAll(ctx.Request().Body)
|
||||
|
|
@ -129,7 +129,7 @@ type ServiceAreaAddrListResponse struct {
|
|||
|
||||
// 服务区域列表
|
||||
func (p DefParty) serviceAreaAddrList() web_iris.Party {
|
||||
return web_iris.Party{Perfix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
return web_iris.Party{Prefix: p.Prefix, PartyFunc: func(index iris.Party) {
|
||||
index.Post(ServiceBase+"/serviceAreaAddrList", func(ctx *context.Context) {
|
||||
var serviceAddrList []models.ServiceAddr
|
||||
database.Instance().Model(&models.ServiceAddr{}).Find(&serviceAddrList)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ type WebServer struct {
|
|||
// - perfix
|
||||
// - partyFunc
|
||||
type Party struct {
|
||||
Perfix string
|
||||
Prefix string
|
||||
PartyFunc func(index iris.Party)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ func (ws *WebServer) InitRouter() error {
|
|||
}
|
||||
|
||||
for _, party := range ws.parties {
|
||||
app.PartyFunc(party.Perfix, party.PartyFunc)
|
||||
app.PartyFunc(party.Prefix, party.PartyFunc)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue