123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- package http
- import (
- "context"
- "net/http"
- "strconv"
- "go-common/app/admin/main/mcn/model"
- "go-common/library/net/http/blademaster"
- )
- func mcnSignEntry(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNSignEntryReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNSignEntryReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.McnSignEntry(cont, arg.(*model.MCNSignEntryReq))
- },
- "mcnSignEntry")(c)
- }
- func mcnSignList(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNSignStateReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.McnSignList(cont, arg.(*model.MCNSignStateReq))
- },
- "mcnSignList")(c)
- }
- func mcnSignOP(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNSignStateOpReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNSignStateOpReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.McnSignOP(cont, arg.(*model.MCNSignStateOpReq))
- },
- "mcnSignOP")(c)
- }
- func mcnUPReviewList(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNUPStateReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.McnUPReviewList(cont, arg.(*model.MCNUPStateReq))
- },
- "mcnUPReviewList")(c)
- }
- func mcnUPOP(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNUPStateOpReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNUPStateOpReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.McnUPOP(cont, arg.(*model.MCNUPStateOpReq))
- },
- "mcnUPOP")(c)
- }
- func mcnPermitOP(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNSignPermissionReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNSignPermissionReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.McnPermitOP(cont, arg.(*model.MCNSignPermissionReq))
- },
- "McnPermitOP")(c)
- }
- func mcnUPPermitList(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNUPPermitStateReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.McnUPPermitList(cont, arg.(*model.MCNUPPermitStateReq))
- },
- "McnUPPermitList")(c)
- }
- func mcnUPPermitOP(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNUPPermitOPReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNUPPermitOPReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.McnUPPermitOP(cont, arg.(*model.MCNUPPermitOPReq))
- },
- "McnUPPermitOP")(c)
- }
- func mcnList(c *blademaster.Context) {
- httpGetWriterByExport(
- new(model.MCNListReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.MCNList(cont, arg.(*model.MCNListReq))
- },
- "mcnList")(c)
- }
- func mcnPayEdit(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNPayEditReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNPayEditReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.MCNPayEdit(cont, arg.(*model.MCNPayEditReq))
- },
- "mcnPayEdit")(c)
- }
- // func mcnPayEdit(c *blademaster.Context) {
- // httpPostFunCheckCookie(
- // new(model.MCNPayEditReq),
- // func(cont context.Context, arg interface{}) (res interface{}, err error) {
- // var uids,name *http.Cookie
- // args := arg.(*model.MCNPayEditReq)
- // if name, err = c.Request.Cookie("username"); err == nil {
- // args.UserName = name.Value
- // }
- // if uids, err = c.Request.Cookie("uid"); err == nil {
- // if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- // return
- // }
- // }
- // return nil, srv.MCNPayEdit(cont, arg.(*model.MCNPayEditReq))
- // },
- // "mcnPayEdit")(c)
- // }
- func mcnPayStateEdit(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNPayStateEditReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNPayStateEditReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.MCNPayStateEdit(cont, arg.(*model.MCNPayStateEditReq))
- },
- "mcnPayStateEdit")(c)
- }
- func mcnStateEdit(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNStateEditReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNStateEditReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.MCNStateEdit(cont, arg.(*model.MCNStateEditReq))
- },
- "mcnStateEdit")(c)
- }
- func mcnRenewal(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNRenewalReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNRenewalReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.MCNRenewal(cont, arg.(*model.MCNRenewalReq))
- },
- "mcnRenewal")(c)
- }
- func mcnInfo(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNInfoReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.MCNInfo(cont, arg.(*model.MCNInfoReq))
- },
- "mcnInfo")(c)
- }
- func mcnUPList(c *blademaster.Context) {
- httpGetWriterByExport(
- new(model.MCNUPListReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.MCNUPList(cont, arg.(*model.MCNUPListReq))
- },
- "mcnUPList")(c)
- }
- func mcnUPStatEdit(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNUPStateEditReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNUPStateEditReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.MCNUPStateEdit(cont, arg.(*model.MCNUPStateEditReq))
- },
- "mcnUPStatEdit")(c)
- }
- func mcnCheatList(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNCheatListReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.MCNCheatList(cont, arg.(*model.MCNCheatListReq))
- },
- "mcnCheatList")(c)
- }
- func mcnCheatUPList(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNCheatUPListReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.MCNCheatUPList(cont, arg.(*model.MCNCheatUPListReq))
- },
- "mcnCheatUPList")(c)
- }
- func mcnImportUPInfo(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNImportUPInfoReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.MCNImportUPInfo(cont, arg.(*model.MCNImportUPInfoReq))
- },
- "mcnImportUPInfo")(c)
- }
- func mcnImportUPRewardSign(c *blademaster.Context) {
- httpPostJSONCookie(
- new(model.MCNImportUPRewardSignReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- var uids, name *http.Cookie
- args := arg.(*model.MCNImportUPRewardSignReq)
- if name, err = c.Request.Cookie("username"); err == nil {
- args.UserName = name.Value
- }
- if uids, err = c.Request.Cookie("uid"); err == nil {
- if args.UID, err = strconv.ParseInt(uids.Value, 10, 64); err != nil {
- return
- }
- }
- return nil, srv.MCNImportUPRewardSign(cont, arg.(*model.MCNImportUPRewardSignReq))
- },
- "mcnImportUPRewardSign")(c)
- }
- func mcnIncreaseList(c *blademaster.Context) {
- httpGetFunCheckCookie(
- new(model.MCNIncreaseListReq),
- func(cont context.Context, arg interface{}) (res interface{}, err error) {
- return srv.MCNIncreaseList(cont, arg.(*model.MCNIncreaseListReq))
- },
- "mcnIncreaseList")(c)
- }
|