diff --git a/business/api/auth.go b/business/api/auth.go index 38d71bd..531f786 100644 --- a/business/api/auth.go +++ b/business/api/auth.go @@ -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 diff --git a/business/api/goods.go b/business/api/goods.go index 630712c..4919a05 100644 --- a/business/api/goods.go +++ b/business/api/goods.go @@ -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) diff --git a/business/api/init.go b/business/api/init.go index 0188fa8..f2ebcf6 100644 --- a/business/api/init.go +++ b/business/api/init.go @@ -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") }) diff --git a/business/api/order.go b/business/api/order.go index e5d4736..4324a9e 100644 --- a/business/api/order.go +++ b/business/api/order.go @@ -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) { }) diff --git a/business/api/pet.go b/business/api/pet.go index d0b4d6c..153d84a 100644 --- a/business/api/pet.go +++ b/business/api/pet.go @@ -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) diff --git a/business/api/service.go b/business/api/service.go index 9699194..b2d6378 100644 --- a/business/api/service.go +++ b/business/api/service.go @@ -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) diff --git a/core/server/web/web_iris/index.go b/core/server/web/web_iris/index.go index 8fe9bba..aff472a 100644 --- a/core/server/web/web_iris/index.go +++ b/core/server/web/web_iris/index.go @@ -37,7 +37,7 @@ type WebServer struct { // - perfix // - partyFunc type Party struct { - Perfix string + Prefix string PartyFunc func(index iris.Party) } diff --git a/core/server/web/web_iris/router.go b/core/server/web/web_iris/router.go index e49375b..7de08ca 100644 --- a/core/server/web/web_iris/router.go +++ b/core/server/web/web_iris/router.go @@ -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) } }