control

package
v0.0.0-...-8587cce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReceiver

func AddReceiver(context *gin.Context)

func AddToCart

func AddToCart(context *gin.Context)

购物车 @Summary 添加商品到购物车 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/AddToCart [get]

func AddressDefault

func AddressDefault(context *gin.Context)

获取默认 address 详情 @Summary 获取默认 address 详情 @Tags AddressController @Accept json @Produce json @Success 200 {object} model.Address @Router /api/app/address_default [get]

func AddressDetail

func AddressDetail(context *gin.Context)

获取 address 详情 @Summary 获取 address 详情 @Tags AddressController @Accept json @Produce json @Success 200 {object} model.Address @Router /api/app/address_detail [get]

func AddressList

func AddressList(context *gin.Context)

用户 @Summary 用户邮寄地址 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/address_list [get]

func AppExchangeToken

func AppExchangeToken(context *gin.Context)

func AppWeChatPay

func AppWeChatPay(context *gin.Context)

app 的 wechat 支付 @Summary app 的 wechat 支付,传 product_id 按 product_id 查 @Tags PayController @Consumes formData @Produce json @Param Gin-Access-Token header string true "令牌" @Param product_id query string true "产品记录id" @Router /api/app/wechat_pay [post]

func AreaList

func AreaList(context *gin.Context)

省份列表 @Summary 省份列表 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/common/area_list [get]

func Auth

func Auth(context *gin.Context)

wechat授权,建立必要的 session, 然后跳转到授权页面 @Summary wechat授权 @Tags UserController @Accept json @Produce json @Param username query string true "用户名" @Param password query string true "密码" @Param phone query string true "电话号码" @Param email query string true "邮件" @Success 200 {object} helpers.JsonObject @Router /api/wechat/auth [post]

func BannerDetail

func BannerDetail(context *gin.Context)

获取 banner 详情 @Summary 获取 banner 详情 @Tags BannerController @Accept json @Produce json @Param banner_id query string true "列表的banner_id" @Success 200 {object} model.Banner @Router /api/app/banner_detail [get]

func BannerList

func BannerList(context *gin.Context)

获取 banner 轮播图 @Summary 获取 banner 轮播图,传 banner_id 按 banner_id 查,不传就查平台的 @Tags BannerController @Accept json @Produce json @Param shop_id query string false "产品记录id" @Success 200 {object} model.Banner @Router /api/banner/list [get]

func BannerListAll

func BannerListAll(context *gin.Context)

获取 banner 列表 @Summary 获取 banner 列表 @Tags BannerController @Accept json @Produce json @Success 200 {object} model.ListsResponse @Router /api/banner_list_all [get]

func BargainProduct

func BargainProduct(context *gin.Context)

func CategoryList

func CategoryList(context *gin.Context)

产品分类 @Summary 用户积分 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/shop/category/list [get]

func Check

func Check(context *gin.Context)

版本校验 @Summary 版本校验 @Accept json @Produce json @Tags ScoreController @Success 200 {object} helpers.JsonObject @Router /api/version/check [get]

func CheckTokenWeChat

func CheckTokenWeChat(context *gin.Context)

func CityList

func CityList(context *gin.Context)

省份列表 @Summary 省份列表 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/common/city_list [get]

func CombineKey

func CombineKey(context *gin.Context)

产品分类 @Summary 用户积分 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/sku_list [get]

func CreateOrder

func CreateOrder(context *gin.Context)

创建定单

func CreateOrderPrepare

func CreateOrderPrepare(context *gin.Context)

func DemoList

func DemoList(context *gin.Context)

产品分类 @Summary 用户积分 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/demo_list [get]

func ExchangeToken

func ExchangeToken(context *gin.Context)

授权后回调页面

func ExportUserInfos

func ExportUserInfos(context *gin.Context)

导出用户信息 @Summary 用户信息回显,传id按id查,传username按用户名查 @Tags UserController @Router /api/export_user_infos [get]

func FeedbackDetail

func FeedbackDetail(context *gin.Context)

获取 feedback 详情 @Summary 获取 feedback 详情 @Tags FeedbackController @Accept json @Produce json @Param feedback_id query string true "列表的feedback_id" @Success 200 {object} model.Feedback @Router /api/feedback_detail [get]

func FeedbackList

func FeedbackList(context *gin.Context)

获取 feedback 列表 @Summary 获取 feedback 列表,传 feedback_id 按 feedback_id 查,不传就查平台的 @Tags FeedbackController @Accept json @Produce json @Param shop_id query string false "产品记录id" @Success 200 {object} model.Feedback @Router /api/app/feedback_list [get]

func FeedbackListAll

func FeedbackListAll(context *gin.Context)

获取 feedback 列表 @Summary 获取 feedback 列表 @Tags FeedbackController @Accept json @Produce json @Success 200 {object} model.ListsResponse @Router /api/feedback_list_all [get]

func GetProductListByOrderId

func GetProductListByOrderId(db *gorm.DB, orderId uint64) []*model.Product

func GetProductListByOrderProductList

func GetProductListByOrderProductList(db *gorm.DB, orderProductList []*model.OrderProduct) []*model.Product

func LevelCost

func LevelCost(userId uint64, productId uint64, cost *model.Cost)

func Liquidate

func Liquidate(context *gin.Context)

获取 merchantOrderDetail 列表 @Summary 获取 merchantOrderDetail 列表 @Tags MerchantOrderDetailController @Accept json @Produce json @Success 200 {object} model.MerchantOrderListsResponse @Router /api/app/order/liquidate [post]

func LiquidateTotal

func LiquidateTotal(context *gin.Context)

获取 merchantOrderDetail 列表 @Summary 获取 merchantOrderDetail 列表 @Tags MerchantOrderDetailController @Accept json @Produce json @Success 200 {object} model.MerchantOrderListsResponse @Router /api/app/order/liquidate_total [get]

func Login

func Login(context *gin.Context)

用户登陆接口 @Summary 用户登陆接口 @Tags LoginController @Accept json @Produce json @Param username query string true "用户名" @Param password query string true "密码" @Success 200 {object} helpers.JsonObject @Router /api/login [post]

func LoginByWeChat

func LoginByWeChat(context *gin.Context)

func Logout

func Logout(context *gin.Context)

func MerchantDetail

func MerchantDetail(context *gin.Context)

获取 merchant(商户) 详情 @Summary 获取 merchant(商户) 详情 @Tags MerchantController @Accept json @Produce json @Success 200 {object} model.Product @Router /api/merchant_detail [get]

func MerchantDetailWithShop

func MerchantDetailWithShop(context *gin.Context)

获取 product 列表 @Summary 获取 product 列表 @Tags MerchantController @Accept json @Produce json @Success 200 {object} model.Product @Router /api/merchant_detail_with_shop [get]

func MerchantEmployeeOrderDetailList

func MerchantEmployeeOrderDetailList(context *gin.Context)

获取 merchantEmployeeOrderDetail 列表 @Summary 获取 merchantEmployeeOrderDetail 列表 @Tags MerchantOrderDetailController @Accept json @Produce json @Success 200 {object} model.MerchantOrderListsResponse @Router /api/app/order/merchant_employee_list [get]

func MerchantList

func MerchantList(context *gin.Context)

获取 merchant 列表 @Summary 获取 merchant 列表 @Tags MerchantController @Accept json @Produce json @Success 200 {object} model.Merchant @Router /api/merchant_list [get]

func MerchantMoneyLog

func MerchantMoneyLog(context *gin.Context)

获取全部 @Summary 获取全部商户结算列表 @Tags MoneyLogController @Accept json @Produce json @Success 200 {object} helpers.JsonObject @Router /api/money_log/list_all [get]

func MerchantOrderDetailDetail

func MerchantOrderDetailDetail(context *gin.Context)

获取 merchantOrderDetail 详情 @Summary 获取 merchantOrderDetail 详情 @Tags MerchantOrderDetailController @Accept json @Produce json @Success 200 {object} model.MerchantOrderDetail @Router /api/app/merchantOrderDetail_detail [get]

func MerchantOrderDetailList

func MerchantOrderDetailList(context *gin.Context)

获取 merchantOrderDetail 列表 @Summary 获取 merchantOrderDetail 列表 @Tags MerchantOrderDetailController @Accept json @Produce json @Success 200 {object} model.MerchantOrderListsResponse @Router /api/app/order/merchant_list [get]

func MerchantOrderDetailListAll

func MerchantOrderDetailListAll(context *gin.Context)

func MerchantRegister

func MerchantRegister(context *gin.Context)

编辑 feedback @Summary feedback 编辑 @Tags FeedbackController @Accept json @Produce json @Success 200 {object} model.Feedback @Router /api/web/merchant/register [post] 以后再移走吧,临时放这里

func MerchantWechatMPRegister

func MerchantWechatMPRegister(context *gin.Context)

wechat授权,建立必要的 session, 然后跳转到授权页面 @Summary 业务员分享给商户注册 @Tags UserController @Accept json @Produce json @Param user_id query string true "用户id" @Success 200 {object} helpers.JsonObject @Router /api/web/merchant/wechat_mp_register [post]

func MerchantWechatMPRegisterToken

func MerchantWechatMPRegisterToken(context *gin.Context)

func MicroWeChatPay

func MicroWeChatPay(context *gin.Context)

微信小程序的 wechat 支付 @Summary app 的 wechat 支付,传 productId 按 productId 查 @Tags PayController @Consumes formData @Produce json @Param Gin-Access-Token header string true "令牌" @Param productId query string true "产品记录id" @Router /api/app/micro_wechat_pay [post]

func MoneyLogList

func MoneyLogList(context *gin.Context)

获取当前商户的全部结算列表 @Summary 获取当前商户结算列表 @Tags MoneyLogController @Accept json @Produce json @Success 200 {object} helpers.JsonObject @Router /api/app/money_log/list [get]

func OptionList

func OptionList(context *gin.Context)

产品分类 @Summary 用户积分 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/option_list [get]

func OrderDetail

func OrderDetail(context *gin.Context)

获取 order 详情 @Summary 获取 order 详情 @Tags OrderController @Accept json @Produce json @Success 200 {object} model.Order @Router /api/app/order_detail [get]

func OrderList

func OrderList(context *gin.Context)

获取 order 列表 @Summary 获取 order 列表 @Tags OrderController @Accept json @Produce json @Success 200 {object} model.ListsResponse @Router /api/app/order/list [get]

func OrderListAll

func OrderListAll(context *gin.Context)

func OrderProductList

func OrderProductList(context *gin.Context)

产品分类 @Summary 用户积分 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/OrderProduct_list [get]

func ProductDetail

func ProductDetail(context *gin.Context)

获取 product 详情 @Summary 获取 product 详情 @Tags ProductController @Accept json @Produce json @Success 200 {object} model.Product @Router /api/shop/product_detail [get]

func ProductList

func ProductList(context *gin.Context)

获取 product 列表 @Summary 获取 product 列表 @Tags ProductController @Accept json @Produce json @Success 200 {object} model.ListsResponse @Router /api/shop/product_list [get]

func ProductListAll

func ProductListAll(context *gin.Context)

func ProductPrice

func ProductPrice(context *gin.Context)

func ProvinceList

func ProvinceList(context *gin.Context)

省份列表 @Summary 省份列表 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/common/province_list [get]

func Register

func Register(context *gin.Context)

用户注册 @Summary 用户注册 @Tags UserController @Accept json @Produce json @Param username query string true "用户名" @Param password query string true "密码" @Param phone query string true "电话号码" @Param email query string true "邮件" @Success 200 {object} helpers.JsonObject @Router /api/register [post]

func RegisterByWeChat

func RegisterByWeChat(context *gin.Context)

这个函数以 code 作为输入, 返回调用微信接口得到的对象指针和异常情况

func RemoveBanner

func RemoveBanner(context *gin.Context)

删除 banner @Summary 删除 banner @Tags BannerController @Accept json @Produce json @Success 200 {object} model.Banner @Router /api/banner/remove [delete]

func SaveAddress

func SaveAddress(context *gin.Context)

添加收货地址 @Summary 添加收货地址 @Tags AddressController @Accept json @Produce json @Success 200 {object} model.Address @Router /api/address/save [post]

func SaveBanner

func SaveBanner(context *gin.Context)

编辑 banner @Summary banner 编辑 @Tags BannerController @Accept json @Produce json @Success 200 {object} model.Banner @Router /api/banner/save [post]

func SaveFeedback

func SaveFeedback(context *gin.Context)

编辑 feedback @Summary feedback 编辑 @Tags FeedbackController @Accept json @Produce json @Success 200 {object} model.Feedback @Router /api/feedback/save [post]

func SaveMerchant

func SaveMerchant(context *gin.Context)

添加 merchant @Summary 添加 merchant @Tags MerchantController @Accept json @Produce json @Success 200 {object} model.Merchant @Router /api/merchant/save [post]

func SaveMerchantOrderDetail

func SaveMerchantOrderDetail(context *gin.Context)

编辑 merchantOrderDetail @Summary merchantOrderDetail 编辑 @Tags MerchantOrderDetailController @Accept json @Produce json @Success 200 {object} model.MerchantOrderDetail @Router /api/merchantOrderDetail/verification [post]

func SaveProduct

func SaveProduct(context *gin.Context)

编辑 product @Summary product 编辑 @Tags ProductController @Accept json @Produce json @Success 200 {object} model.Product @Router /api/product/save [post]

func SaveRole

func SaveRole(context *gin.Context)

添加修改角色 @Summary 添加修改角色 @Tags RoleController @Accept json @Produce json @Param id query string false "角色id,新增时id为空" @Param role_name query string true "角色名称" @Param role_key query string true "角色类别标识" @Param description query string true "角色描述信息" @Success 200 {object} helpers.JsonObject @Router /api/save_role [post]

func SaveShop

func SaveShop(context *gin.Context)

编辑 shop @Summary shop 编辑 @Tags ShopController @Accept json @Produce json @Success 200 {object} model.Shop @Router /api/shop/save [post]

func SaveUser

func SaveUser(context *gin.Context)

添加、修改用户信息 @Summary 添加、修改用户信息 @Tags UserController @Accept json @Produce json @Param user_id query string false "用户记录id" @Param username query string true "用户名" @Param password query string true "密码" @Param phone query string true "电话号码" @Param email query string true "邮件" @Param merchant_no query string true "商户号" @Param role_id query string true "角色id" @Success 200 {object} helpers.JsonObject @Router /api/user/save [post]

func SaveUserOrderDetail

func SaveUserOrderDetail(context *gin.Context)

编辑 userOrderDetail @Summary userOrderDetail 编辑 @Tags UserOrderDetailController @Accept json @Produce json @Success 200 {object} model.UserOrderDetail @Router /api/userOrderDetail/verification [post]

func Score

func Score(context *gin.Context)

用户钱包 @Summary 获取用户积分 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/score [get]

func SetDefaultAddress

func SetDefaultAddress(context *gin.Context)

把收货地址置为默认的,前端这个写得不好,先保留了 @Summary 添加收货地址 @Tags AddressController @Accept json @Produce json @Success 200 {object} model.Address @Router /api/set_default_address [post]

func ShopDetail

func ShopDetail(context *gin.Context)

获取 shop(店铺) 详情 @Summary 获取 shop(店铺) 详情 @Tags ShopController @Accept json @Produce json @Param shop_id query string true "商户列表的shop_id" @Success 200 {object} model.Product @Router /api/shop_detail [get]

func ShopDetailWithProduct

func ShopDetailWithProduct(context *gin.Context)

获取带 product 的店铺详情 @Summary 获取带 product 的店铺详情 @Tags ShopController @Accept json @Produce json @Param shop_id query string true "商户列表的shop_id" @Success 200 {object} model.Product @Router /api/shop_detail_with_product [get]

func ShopList

func ShopList(context *gin.Context)

获取 shop 列表 @Summary 获取 shop 列表 @Tags ShopController @Accept json @Produce json @Success 200 {object} model.Shop @Router /api/app/shop_list [get]

func ShopListNearby

func ShopListNearby(context *gin.Context)

获取附近 shop 列表 @Summary 获取附近 shop 列表 @Tags ShopController @Accept json @Produce json @Success 200 {object} model.Shop @Router /api/app/shop_list_nearby [get]

func ShoppingCartInfo

func ShoppingCartInfo(context *gin.Context)

@Summary 获取购物车信息 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/ShoppingCartInfo [get]

func Statistics

func Statistics(context *gin.Context)

func UpdateMoneyLog

func UpdateMoneyLog(context *gin.Context)

更新商户结算状态 @Summary 更新商户结算状态 @Tags MoneyLogController @Accept json @Produce json @Success 200 {object} helpers.JsonObject @Router /api/money_log/update [post]

func UpdateOrderAfterPay

func UpdateOrderAfterPay(context *gin.Context)

小程序客户端支付成功后,更新订单状态

func UserInfo

func UserInfo(context *gin.Context)

用户信息回显 @Summary 用户信息回显,传id按id查,传username按用户名查 @Tags UserController @Accept json @Produce json @Param Gin-Access-Token header string true "令牌" @Success 200 {object} model.User @Router /api/user/info [get]

func UserOrderDetailDetail

func UserOrderDetailDetail(context *gin.Context)

获取 userOrderDetail 详情 @Summary 获取 userOrderDetail 详情 @Tags UserOrderDetailController @Accept json @Produce json @Success 200 {object} model.UserOrderDetail @Router /api/app/userOrderDetail_detail [get]

func UserOrderDetailList

func UserOrderDetailList(context *gin.Context)

获取 userOrderDetail 列表 @Summary 获取 userOrderDetail 列表 @Tags UserOrderDetailController @Accept json @Produce json @Success 200 {object} model.UserOrderListsResponse @Router /api/app/order/user_list [get]

func UserOrderDetailListAll

func UserOrderDetailListAll(context *gin.Context)

func VerificationOrder

func VerificationOrder(context *gin.Context)

编辑 order @Summary order 核销 @Tags OrderController @Accept json @Param check_user_id query string true "店员的user_id" @Param money query int64 true "当前核销的金额,为代金券时必传" @Param number query int true "当前核销的数量,为实物时必传" @Param shop_id query string true "支付的店铺id" @Produce json @Success 200 {object} model.Order @Router /api/order/verification [post]

func Wallet

func Wallet(context *gin.Context)

@Summary 获取用户积分 @Accept json @Produce json @Tags ScoreController @Param Gin-Access-Token header string true "令牌" @Success 200 {object} helpers.JsonObject @Router /api/user/score [get]

func WechatAppPayCallback

func WechatAppPayCallback(context *gin.Context)

app 的 wechat 支付回调 @Summary app 的 wechat 支付回调 @Tags PayController @Accept json @Produce json @Success 200 {object} model.AppWechatPay @Router /api/app/wechat_pay_callback [get]

func WechatMPCallBack

func WechatMPCallBack(context *gin.Context)

微信公众号回调 /api/web/mpcallback

func WechatMPConfigCallBack

func WechatMPConfigCallBack(context *gin.Context)

func WechatMPRegister

func WechatMPRegister(context *gin.Context)

wechat授权,建立必要的 session, 然后跳转到授权页面 @Summary wechat授权 @Tags UserController @Accept json @Produce json @Param username query string true "用户名" @Param password query string true "密码" @Param phone query string true "电话号码" @Param email query string true "邮件" @Success 200 {object} helpers.JsonObject @Router /api/wechat/wechat_mp_register [post]

Types

type LoginForm

type LoginForm struct {
	WechatCode string `form:"code" binding:"required" json:"code"`
}

type RegisterForm

type RegisterForm struct {
	WechatCode    string `form:"code" binding:"required" json:"code"`
	EncryptedData string `form:"encryptedData" binding:"required" json:"encryptedData"`
	Iv            string `form:"iv" binding:"required" json:"iv"`
	Referrer      string `form:"referrer" json:"referrer"`
}

type WXLoginResp

type WXLoginResp struct {
	OpenId     string `json:"openid"`
	SessionKey string `json:"session_key"`
	UnionId    string `json:"unionid"`
	ErrCode    int    `json:"errcode"`
	ErrMsg     string `json:"errmsg"`
	Code       string `json:"code"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL