add and fix apis

This commit is contained in:
2026-10-28 13:27:20 +08:00
parent 38cffc2f2a
commit 8775847d20
12 changed files with 176 additions and 43 deletions
@@ -30,21 +30,12 @@ func NewGetWsCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWsCo
}
func (l *GetWsCodeLogic) GetWsCode(in *percutaneous.GetWsCodeRequest) (*percutaneous.Response, error) {
id := in.UserId
if id < utils.NumberOne {
adminInfo := utils.GetUserFromCtx(l.ctx)
if adminInfo.ID < utils.NumberOne {
return l.fail(utils.ErrorNoLoginInfo)
}
id = adminInfo.ID
}
Type := WsTypeApp
if in.Type == utils.NumberTwo {
Type = WsTypeOperation
}
key := utils.MD5Encrypt(fmt.Sprintf("%d%s%s", id, dao.WsCode, Type))
key := utils.MD5Encrypt(fmt.Sprintf("%s%s", dao.WsCode, Type))
redisKey := pkgws.RedisKeyQRSession + key
payload, err := jsoniter.MarshalToString(pkgws.Session{