123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
- // source: api.proto
- /*
- Package api is a generated blademaster stub package.
- This code was generated with go-common/app/tool/bmgen/protoc-gen-bm v0.1.
- It is generated from these files:
- api.proto
- */
- package api
- import (
- "context"
- bm "go-common/library/net/http/blademaster"
- "go-common/library/net/http/blademaster/binding"
- )
- // to suppressed 'imported but not used warning'
- var _ *bm.Context
- var _ context.Context
- var _ binding.StructValidator
- var PathPassportSNSGetAuthorizeURL = "/x/internal/passport-sns/authorize/url"
- var PathPassportSNSBind = "/x/internal/passport-sns/bind"
- var PathPassportSNSUnbind = "/x/internal/passport-sns/unbind"
- var PathPassportSNSGetInfo = "/x/internal/passport-sns/info"
- var PathPassportSNSGetInfoByCode = "/x/internal/passport-sns/info/code"
- var PathPassportSNSUpdateInfo = "/x/internal/passport-sns/info/update"
- // =====================
- // PassportSNS Interface
- // =====================
- type PassportSNSBMServer interface {
- // GetAuthorizeURL get authorize url
- GetAuthorizeURL(ctx context.Context, req *GetAuthorizeURLReq) (resp *GetAuthorizeURLReply, err error)
- // Bind bind sns account
- Bind(ctx context.Context, req *BindReq) (resp *EmptyReply, err error)
- // Unbind unbind sns account
- Unbind(ctx context.Context, req *UnbindReq) (resp *EmptyReply, err error)
- // GetInfo get info by mid
- GetInfo(ctx context.Context, req *GetInfoReq) (resp *GetInfoReply, err error)
- // GetInfoByCode get info by authorize code
- GetInfoByCode(ctx context.Context, req *GetInfoByCodeReq) (resp *GetInfoByCodeReply, err error)
- // UpdateInfo update info
- UpdateInfo(ctx context.Context, req *UpdateInfoReq) (resp *EmptyReply, err error)
- }
- var PassportSNSSvc PassportSNSBMServer
- func passportSNSGetAuthorizeURL(c *bm.Context) {
- p := new(GetAuthorizeURLReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := PassportSNSSvc.GetAuthorizeURL(c, p)
- c.JSON(resp, err)
- }
- func passportSNSBind(c *bm.Context) {
- p := new(BindReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := PassportSNSSvc.Bind(c, p)
- c.JSON(resp, err)
- }
- func passportSNSUnbind(c *bm.Context) {
- p := new(UnbindReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := PassportSNSSvc.Unbind(c, p)
- c.JSON(resp, err)
- }
- func passportSNSGetInfo(c *bm.Context) {
- p := new(GetInfoReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := PassportSNSSvc.GetInfo(c, p)
- c.JSON(resp, err)
- }
- func passportSNSGetInfoByCode(c *bm.Context) {
- p := new(GetInfoByCodeReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := PassportSNSSvc.GetInfoByCode(c, p)
- c.JSON(resp, err)
- }
- func passportSNSUpdateInfo(c *bm.Context) {
- p := new(UpdateInfoReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := PassportSNSSvc.UpdateInfo(c, p)
- c.JSON(resp, err)
- }
- // RegisterPassportSNSService Register the blademaster route with middleware map
- // midMap is the middleware map, the key is defined in proto
- func RegisterPassportSNSService(e *bm.Engine, svc PassportSNSBMServer, midMap map[string]bm.HandlerFunc) {
- PassportSNSSvc = svc
- e.GET("/x/internal/passport-sns/authorize/url", passportSNSGetAuthorizeURL)
- e.POST("/x/internal/passport-sns/bind", passportSNSBind)
- e.POST("/x/internal/passport-sns/unbind", passportSNSUnbind)
- e.GET("/x/internal/passport-sns/info", passportSNSGetInfo)
- e.GET("/x/internal/passport-sns/info/code", passportSNSGetInfoByCode)
- e.POST("/x/internal/passport-sns/info/update", passportSNSUpdateInfo)
- }
- // RegisterPassportSNSBMServer Register the blademaster route
- func RegisterPassportSNSBMServer(e *bm.Engine, server PassportSNSBMServer) {
- PassportSNSSvc = server
- e.GET("/x/internal/passport-sns/authorize/url", passportSNSGetAuthorizeURL)
- e.POST("/x/internal/passport-sns/bind", passportSNSBind)
- e.POST("/x/internal/passport-sns/unbind", passportSNSUnbind)
- e.GET("/x/internal/passport-sns/info", passportSNSGetInfo)
- e.GET("/x/internal/passport-sns/info/code", passportSNSGetInfoByCode)
- e.POST("/x/internal/passport-sns/info/update", passportSNSUpdateInfo)
- }
|