123456789101112131415161718192021222324252627282930313233 |
- package user_merchant
- import (
- "context"
- "gd_management/apis"
- "gd_management/common.in/utils"
- "gd_management/impl/pubsub"
- "github.com/astaxie/beego/orm"
- "go.uber.org/zap"
- )
- func ManagementSetUserMerchantAuthState(ctx context.Context, req *apis.ManagementSetUserMerchantAuthStateReq, reply *apis.ManagementSetUserMerchantAuthStateReply) (err error) {
- o := orm.NewOrm()
- _, err = o.Raw("update t_gd_merchants set auth_status=? where id=?", req.State, req.MerchantId).Exec()
- if err != nil {
- l.Error("func",
- zap.String("call", "ManagementSetUserMerchantAuthState"),
- zap.String("args", utils.MarshalJsonString(req)),
- zap.String("error", err.Error()))
- }
- tab := apis.TGdMerchants{}
- o.QueryTable("t_gd_merchants").Filter("id", req.MerchantId).One(&tab)
- utils.RedisSet("t_gd_merchants", tab.AppKey, tab)
- if err := pubsub.PublishMerchantNotify(tab.AppKey); err != nil {
- return err
- }
- l.Debug(utils.MarshalJsonString(req, reply))
- return
- }
|