package asUser import ( "context" "errors" "fmt" "github.com/fonchain_enterprise/fonchain-main/api/account" "github.com/fonchain_enterprise/fonchain-main/api/artist" "github.com/fonchain_enterprise/fonchain-main/api/artistInfoArtwork" "github.com/fonchain_enterprise/fonchain-main/api/artistInfoUser" "github.com/fonchain_enterprise/fonchain-main/api/artistinfoArtshow" "github.com/fonchain_enterprise/fonchain-main/api/digital_copyright" "github.com/fonchain_enterprise/fonchain-main/pkg/config" "github.com/fonchain_enterprise/fonchain-main/pkg/e" "github.com/fonchain_enterprise/fonchain-main/pkg/model/login" "github.com/fonchain_enterprise/fonchain-main/pkg/model/union" "github.com/fonchain_enterprise/fonchain-main/pkg/serializer" "github.com/fonchain_enterprise/fonchain-main/pkg/service" "github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asPush" "github.com/fonchain_enterprise/fonchain-main/pkg/utils" "github.com/fonchain_enterprise/fonchain-main/pkg/utils/secret" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/nacos-group/nacos-sdk-go/common/logger" "go.uber.org/zap" "sort" "strings" "time" ) // //用户锁 func LockUser(c *gin.Context) { var req artistInfoUser.UserLockRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { service.Error(c, e.InvalidParams, err) return } //_, err := service.GrpcArtistInfoUserImpl.UpdateUserData(c, // &asUser.UserInfo{MgmtAccId: req.AccId, IsLock: req.Lock}, //) userInfo, err := service.GrpcArtistInfoUserImpl.FindUser(c, &artistInfoUser.FindUserRequest{ MgmtAccId: req.AccId, }) if err != nil { service.ErrorWithMark(c, e.Failed, err, "LockUser: FindUser Error ", err.Error()) return } if userInfo.IsLock == false && req.IsLock == false { service.Error(c, e.Failed, errors.New("用户当前已处于解锁状态")) return } else if userInfo.IsLock == true && req.IsLock == true { service.Error(c, e.Failed, errors.New("用户当前已处于锁定状态")) return } //锁定/解锁用户 lockStatus, err := service.GrpcArtistInfoUserImpl.UserLock(c, &req) if err != nil { service.ErrorWithMark(c, e.Failed, err, "LockUser: UserLock Error ", err.Error()) return } if lockStatus.ErrMsg != "" { service.ErrorWithMark(c, e.Failed, nil, "LockUser: UserLock Error 22", lockStatus.ErrMsg) return } //修改画作锁定/解锁状态 todo 后面加到服务端 var lockAction int32 = 3 if req.IsLock { lockAction = 2 } _, err = service.GrpcArtistInfoArtworkImpl.ArtworkLockAction(c, &artistInfoArtwork.ArtworkLockActionRequest{ ArtistUid: userInfo.MgmtArtistUid, Lock: lockAction, LockTime: lockStatus.LockTime, }) if err != nil { service.ErrorWithMark(c, e.Failed, err, fmt.Sprintf("LockUser: ArtworkLockAction:%d Error ", lockAction)) return } //获取锁定且审批通过的画作,然后按照画作数量发送画作补充信息的通知 if req.IsLock { go func() { artworkResList, errs := service.GrpcArtistInfoArtworkImpl.GetArtworkLockRecords(c, &artistInfoArtwork.GetArtworkLockRecordsRequest{ Page: 1, PageSize: -1, Where: fmt.Sprintf("status = 2 AND base_audit_status = 4 AND artist_uid = '%s'", userInfo.MgmtArtistUid), }) if errs == nil && artworkResList.Total > 0 { fmt.Println("artworkResList.Total", artworkResList.Total) push := asPush.NewPusher() for i := range artworkResList.Data { fmt.Println("i", i) err = push.ArtworkSupplementNotice(userInfo.Id) if err != nil { fmt.Println("发送画作补充信息app通知失败", err) } else { fmt.Println("发送画作补充信息app通知成功,userId:", userInfo.Id) } time.Sleep(time.Second * 2) } } }() } //UpdateOperationTime(c, artistinfoArtshow.OdType_artistBaseInfo, userInfo.Id) //循环引爆 //更新物理视图 //go asUser.DynamicUserService.UpdateUser(userInfo.MgmtArtistUid) //如果解锁用户,需要把所有邀请函都归为历史 if req.IsLock == false { _, err = service.GrpcArtistImpl.InvitationLetterSetToHistory(c, &artist.InvitationLetterSetToHistoryReq{ ArtistUid: userInfo.MgmtArtistUid, }) if err != nil { zap.L().Error("LockUser: InvitationLetterSetToHistory Error ", zap.Error(err)) fmt.Println("LockUser: InvitationLetterSetToHistory Error", err.Error()) service.ErrorWithMark(c, e.Failed, err, "LockUser: InvitationLetterSetToHistory Error ", err.Error()) return } } service.Success(c) } // 撤回锁定 func LockRollBack(c *gin.Context) { var req artistInfoUser.LockRollbackRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { service.Error(c, e.InvalidParams, err) return } //_, err := service.GrpcArtistInfoUserImpl.UpdateUserData(c, // &asUser.UserInfo{MgmtAccId: req.AccId, IsLock: req.Lock}, //) _, err := service.GrpcArtistInfoUserImpl.LockRollback(c, &req) if err != nil { service.ErrorWithMark(c, e.Failed, err, "LockUser: FindUser Error ", err.Error()) return } UpdateOperationTime(c, artistinfoArtshow.OdType_artistBaseInfo, req.Uid) service.Success(c) } func GetInvitedListByBackendSide2(c *gin.Context) { var req GetInvitedListByBackendSide2Request if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { service.Error(c, e.InvalidParams, err, err.Error()) return } //如果没有提供邀请码则使用token中的用户id进行查询 if req.InviterCode == "" { req.RemoveHiddenObjects = "1" //去除不对经纪人展示的画家 req.OmitJoinShow = true //经纪人管理模块需要忽略已经参加过画展的画家 userInfo := login.GetUserInfoFromCNoPanic(c) if userInfo.ID == 0 { service.ResponseMsg(c, e.SUCCESS, serializer.Response{ Msg: "token解析失败", Status: e.Failed, }) return } //查询邀请码 accountInfo, err := service.AccountProvider.Info(c, &account.InfoRequest{ Domain: "fontree", ID: userInfo.ID, }) if err != nil { logger.Errorf("service.AccountProvider.Info err", err) service.ResponseMsg(c, e.SUCCESS, serializer.Response{ Msg: e.GetMsg(e.JsonUnmarshal), Status: e.Failed, }) return } if accountInfo.Info == nil { service.ErrorWithMark(c, e.Failed, errors.New("账号不存在"), fmt.Sprintf("%+v", userInfo)) return } if accountInfo.Info.InvitationCode == "" { service.Error(c, e.Failed, errors.New("邀请码为空")) return } req.InviterCode = accountInfo.Info.InvitationCode } //判断是否使用缓存 fmt.Println("req.ArtistIndexEditStatus", req.ArtistIndexEditStatus) fmt.Println("req.ArtistProfileEditStatus", req.ArtistProfileEditStatus) fmt.Println("req.ArtworkSupplementEditStatus", req.ArtworkSupplementEditStatus) fmt.Println("req.CopyrightCommentEditStatus", req.CopyrightCommentEditStatus) if req.ArtistIndexEditStatus != 0 || req.ArtistProfileEditStatus != 0 || req.ArtworkSupplementEditStatus != 0 || req.FddStateSelect != 0 || req.CopyrightCommentEditStatus != 0 { if !utils.Contains([]string{"g5BDC9xr", "0000000E", "000001bC", "000001aD"}, req.InviterCode) && config.AppMode == "prod" { service.Error(c, e.Failed, errors.New("使用了不支持的筛选条件"), "使用了不支持的筛选条件") return } fmt.Println("使用邀请列表缓存数据查询") resp, err := getInvitedListFromCache(&req) if err != nil { service.ErrorWithMark(c, e.Failed, err, "getInvitedListFromCache Error ", err.Error()) return } if req.RealName != "" { var tmp []InviteUserType for _, v := range resp { if strings.Contains(v.InvitedUser.RealName, req.RealName) { tmp = append(tmp, v) } } resp = tmp } var total = len(resp) //分页 if req.Page > 0 && req.PageSize > 0 { start := (req.Page - 1) * req.PageSize end := start + req.PageSize if start > int64(len(resp)) { resp = []InviteUserType{} } else if end > int64(len(resp)) { resp = resp[start:] } else { resp = resp[start:end] } } if resp == nil { resp = []InviteUserType{} } service.ResponseList(c, resp, service.OptionPage(req.Page, req.PageSize, total), service.OptionMsg("查询成功"), service.OptionAddField_ArtshowCount("artistUid")) return } getInvitedList2(c, &req.GetInvitedUserListRequest) } // GetInviterUserList func GetInviterUserList(c *gin.Context) { var req artistInfoUser.GetInviterUserListRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { service.Error(c, e.InvalidParams, err, err.Error()) return } getInviterUserList(c, &req) } // 获取所有受邀请的用户列表 func getInvitedList2(c *gin.Context, req *artistInfoUser.GetInvitedUserListRequest) { res, err := service.GrpcArtistInfoUserImpl.GetInvitedUserList(c, req) if err != nil { service.ErrorWithMark(c, e.Failed, err, "GrpcArtistInfoUserImpl.GetInvitedUserList: Error ", err.Error()) return } fmt.Println("getInvitedList2 111111111111111") respData, err := GetInviteListDataHandle(res.Data) if err != nil { service.ErrorWithMark(c, e.Failed, err, "getInvitedList2: GetInviteListDataHandle Error ", err.Error()) return } service.ResponseList(c, respData, service.OptionPage(res.Page.Page, res.Page.PageSize, res.Page.Total), service.OptionMsg("查询成功"), service.OptionAddField_ArtshowCount("artistUid"), ) } func getInvitedListFromCache(request *GetInvitedListByBackendSide2Request) (data []InviteUserType, err error) { allData, err := CacheInviteList.GetCache() if err != nil { return } if len(allData) == 0 { return } //筛选allData for _, v := range allData { if request.ArtistIndexEditStatus != 0 && v.ArtistIndexEditStatus != request.ArtistIndexEditStatus { continue } if request.ArtistProfileEditStatus != 0 && v.ArtistProfileEditStatus != request.ArtistProfileEditStatus { continue } if request.ArtworkSupplementEditStatus != 0 && v.ArtworkSupplementEditStatus != request.ArtworkSupplementEditStatus { continue } if request.CopyrightCommentEditStatus != 0 && v.CopyrightCommentEditStatus != request.CopyrightCommentEditStatus { continue } if request.RealName != "" && !strings.Contains(v.InvitedUser.RealName, request.RealName) { continue } if request.Keyword != "" && (!strings.Contains(v.InvitedUser.RealName, request.Keyword) || !strings.Contains(v.InvitedUser.TelNum, request.Keyword)) { continue } if request.FddStateSelect != 0 { if request.FddStateSelect == 1 && v.InvitedUser.FddState != 2 { continue } if request.FddStateSelect == 2 && v.InvitedUser.FddState == 2 { continue } } data = append(data, v) } return } func GetInviteListDataHandle(data []*artistInfoUser.InvitedUser) (respData []InviteUserType, err error) { respData = []InviteUserType{} ctx := context.Background() for _, v := range data { //fmt.Println("22222222222222222") var tmp = InviteUserType{ InvitedUser: v, FlowPrice: "0.00", ArtistIndexEditStatus: 2, ArtistProfileEditStatus: 2, ArtworkSupplementEditStatus: 3, CopyrightCommentEditStatus: 3, } if v.FddState == 2 { var priceList *artistinfoArtshow.GetArtshowArtistRulerFloorPriceListResp priceList, err = service.GrpcArtistInfoArtshowImpl.GetArtshowArtistRulerFloorPriceList(ctx, &artistinfoArtshow.GetArtshowArtistRulerFloorPriceListRequest{ Query: &artistinfoArtshow.ArtshowArtistRulerFloorPriceData{ ArtistUid: v.ArtistUid, }, Page: 1, PageSize: -1, Order: "created_at desc", }) if err != nil { zap.L().Error("getInvitedList2: GetArtshowArtistRulerFloorPriceList Error ", zap.Error(err)) } //fmt.Println("3333333333333333333333") if len(priceList.List) > 0 { tmp.FlowPrice = fmt.Sprintf("%2f", priceList.List[0].FloorPrice) } //fmt.Println("444444444444444444444444") // 判断3种数据的填写状态 //1.判断画家指数填写装填 var indexListRes *artistinfoArtshow.GetArtistIndexListResponse indexListRes, err = service.GrpcArtistInfoArtshowImpl.GetArtistIndexList(ctx, &artistinfoArtshow.GetArtistIndexListRequest{ ArtistUid: v.ArtistUid, Page: 1, PageSize: -1, }) if err != nil { fmt.Println("getInvitedList2:GetArtistIndexList Error", err.Error()) zap.L().Error("getInvitedList2:GetArtistIndexList Error", zap.Error(err)) return } // 全部填写完才算已填写 if indexListRes.Page.Total > 0 { var classTitleMap = make(map[string]*artistinfoArtshow.ArtistIndexInfo, 5) for _, class := range []string{"exhibition", "seniority", "specialized", "Influence", "collect"} { var classList []*artistinfoArtshow.ArtistIndexInfo for _, v := range indexListRes.Data { if v.Class == class { classList = append(classList, v) } } //fmt.Println("classList:", classList) if len(classList) == 0 { tmp.ArtistIndexEditStatus = 2 break } else { sort.Slice(classList, func(i, j int) bool { return classList[i].CreatedAt > classList[j].CreatedAt }) tmpIndex := classList[0] classTitleMap[class] = tmpIndex } for _, v := range classTitleMap { if v.TitleScore == 0 { tmp.ArtistIndexEditStatus = 2 break } else { tmp.ArtistIndexEditStatus = 1 } } } } else { tmp.ArtistIndexEditStatus = 2 } //2.判断画家简介填写状态 var artistProfileRes *artistinfoArtshow.ArtistSupplementV2Data artistProfileRes, err = service.GrpcArtistInfoArtshowImpl.GetArtistSupplementV2Detail(ctx, &artistinfoArtshow.GetArtistSupplementV2ByIdRequest{ ArtistUid: v.ArtistUid, }) if err != nil { fmt.Println("getInvitedList2.GetArtistSupplementV2Detail Error", err.Error()) zap.L().Error("getInvitedList2.GetArtistSupplementV2Detail Error", zap.Error(err)) tmp.ArtistProfileEditStatus = 2 } else { //fmt.Println("666666666666666666666666666666") if artistProfileRes.ArtistProfile != "" { tmp.ArtistProfileEditStatus = 1 } else { tmp.ArtistProfileEditStatus = 2 } } //3.判断画作补充填写状态 var thisUser *artistInfoUser.UserInfo thisUser, err = service.GrpcArtistInfoUserImpl.FindUser(ctx, &artistInfoUser.FindUserRequest{ MgmtArtistUid: v.ArtistUid, }) if err != nil { fmt.Println("getInvitedList2: GrpcArtistInfoUserImpl.FindUser Error", err.Error()) zap.L().Error("getInvitedList2: GrpcArtistInfoUserImpl.FindUser Error", zap.Error(err)) tmp.ArtworkSupplementEditStatus = 1 } else { //fmt.Println("77777777777777777777777777777777777777777 v.ArtistUid", v.ArtistUid) var artowkSupplyRes *artistInfoArtwork.GetViewArtworkSupplementListResp artowkSupplyRes, err = service.GrpcArtistInfoArtworkImpl.GetViewArtworkSupplementList(ctx, &artistInfoArtwork.GetViewArtworkSupplementListRequest{ Query: &artistInfoArtwork.ViewArtworkSupplementData{ArtistUid: v.ArtistUid, LockTime: thisUser.LatestLockTime}, Page: 1, PageSize: -1, }) if err != nil { fmt.Println("GetArtworkSupplementStatusList: GrpcArtistInfoArtworkImpl.GetViewArtworkSupplementList Error", err.Error()) zap.L().Error("GetArtworkSupplementStatusList: GrpcArtistInfoArtworkImpl.GetViewArtworkSupplementList Error", zap.Error(err)) return } //fmt.Printf("88888888888888888888888:%+v\n", artowkSupplyRes) tmp.ArtworkSupplementEditStatus = 1 if len(artowkSupplyRes.List) == 0 { //fmt.Println("999999999999999") tmp.ArtworkSupplementEditStatus = 3 } else { for _, v := range artowkSupplyRes.List { if v.CreatedDate == "" && v.FirstPublish == "" && v.InscribeDate == "" { tmp.ArtworkSupplementEditStatus = 2 //fmt.Println("1010101010101") break } } } } //4.判断释义补充信息填写状态 var commentRes *digital_copyright.SupplementListResp commentRes, err = service.GrpcCopyrightImpl.SupplementList(ctx, &digital_copyright.SupplementListReq{ Page: 1, PageSize: -1, ArtistUuid: v.ArtistUid, }) if err != nil { fmt.Println("GetArtworkSupplementStatusList: GrpcCopyrightImpl.SupplementList Error", err.Error()) zap.L().Error("GetArtworkSupplementStatusList: GrpcCopyrightImpl.SupplementList", zap.Error(err)) return } if commentRes.Count > 0 { for _, comment := range commentRes.Data { if comment.RemarkDataIsEmpty { tmp.CopyrightCommentEditStatus = 2 break } } if tmp.CopyrightCommentEditStatus == 3 { tmp.CopyrightCommentEditStatus = 1 } } } respData = append(respData, tmp) } //标记黑名单画家 blackList, err := service.GrpcArtistImpl.BlackList(ctx, &artist.BlackListReq{Page: 1, PageSize: -1, Gender: -1, BlackListStatus: 2}) if err != nil { fmt.Println("GetInviteListDataHandle: GrpcArtistImpl.BlackList Error", err.Error()) } for i, v := range respData { for _, black := range blackList.Data { if v.InvitedUser.ArtistUid == black.ArtistUuid { respData[i].InArtistBlackList = true break } } } return } func getInvitedList3(c *gin.Context, req *artistInfoUser.GetInvitedUserListRequest) { //var resturnData = []InvitedUser{} res, err := service.GrpcArtistInfoUserImpl.GetInvitedUserList(c, req) if err != nil { service.ErrorWithMark(c, e.Failed, err, "GrpcArtistInfoUserImpl.GetInvitedUserList: Error ", err.Error()) return } service.ResponseList(c, res.Data, service.OptionPage(res.Page.Page, res.Page.PageSize, res.Page.Total), service.OptionMsg("查询成功"), service.OptionAddField_ArtshowCount("artistUid"), ) } func getInviterUserList(c *gin.Context, req *artistInfoUser.GetInviterUserListRequest) { res, err := service.GrpcArtistInfoUserImpl.GetInviterUserList(c, req) if err != nil { service.ErrorWithMark(c, e.Failed, err, "GrpcArtistInfoUserImpl.GetInvitedUserList: Error ", err.Error()) return } var resturnData = []InvitedUser{} for _, v := range res.Data { resturnData = append(resturnData, InvitedUser{ UserId: v.UserId, AccId: v.AccId, ArtistUid: v.ArtistUid, TelNum: v.TelNum, InviteCode: v.InviteCode, Account: v.Account, Photo: v.Photo, IsRealName: v.IsRealName, FddState: v.FddState, RealName: v.RealName, Sex: v.Sex, Age: v.Age, CreatedAt: v.CreatedAt, PenName: v.PenName, StageName: v.StageName, IdCard: v.IdCard, InviteTime: v.InviteTime, }) } service.ResponseList(c, resturnData, service.OptionPage(res.Page.Page, res.Page.PageSize, res.Page.Total), service.OptionMsg("查询成功"), service.OptionAddField_ArtshowCount("artistUid"), ) } func BatchCreateQrCode(c *gin.Context) { userRes, err := service.GrpcArtistInfoUserImpl.FindUsers(c, &artistInfoUser.FindUsersRequest{ Page: 1, PageSize: -1, }) if err != nil { service.ErrorWithMark(c, e.Failed, err, "ReCreateQrCode:service.GrpcArtistInfoUserImpl.FindUsers", err.Error()) return } for _, v := range userRes.Data { err = utils.CreateQrCode(v.InviteCode, v.RealName.Name) if err != nil { fmt.Println("二维码生成失败", err.Error()) } } service.Success(c) } func InviteStatic(c *gin.Context) { var req artistInfoUser.GetInviteStaticListRequest if err := c.ShouldBindJSON(&req); err != nil { service.Error(c, e.InvalidParams, err, err.Error()) return } res, err := service.GrpcArtistInfoUserImpl.GetInviteStaticList(c, &req) if err != nil { service.ErrorWithMark(c, e.Failed, err, "InviteStatic GrpcArtistInfoUserImpl.GetInviteStaticList Error") return } var resturnData = []GetInviteStaticListData{} for _, v := range res.Data { resturnData = append(resturnData, GetInviteStaticListData{ Idx: v.Idx, RealName: v.RealName, TelNum: v.TelNum, InviteCode: v.InviteCode, InvitePicUrl: v.InvitePicUrl, InvitedCount: v.InvitedCount, ArtistUid: v.ArtistUid, }) } service.ResponseList(c, resturnData, service.OptionPage(res.Page.Page, res.Page.PageSize, res.Page.Total), service.OptionMsg("查询成功"), service.OptionAddField_ArtshowCount("artistUid"), ) } func GetRealNameAuditList(c *gin.Context) { var req = artistInfoUser.GetRealNameAuditDataListRequest{} if err := c.ShouldBindJSON(&req); err != nil { service.Error(c, e.InvalidParams, err, err.Error()) return } data, err := service.GrpcArtistInfoUserImpl.GetRealNameAuditDataList(c, &req) if err != nil { fmt.Println("GetRealNameAuditList: GrpcArtistInfoUserImpl.GetRealNameAuditDataList Error:" + err.Error()) service.ErrorWithMark(c, e.Failed, err, "GetRealNameAuditList: GrpcArtistInfoUserImpl.GetRealNameAuditDataList Error:"+err.Error(), err.Error()) return } service.ResponseList(c, data.List, service.OptionPage(data.PageInfo.Page, data.PageInfo.PageSize, data.PageInfo.Total), service.OptionMsg("查询成功")) } func EditRealNameAudit(c *gin.Context) { var req = artistInfoUser.RealNameAuditData{} if err := c.ShouldBindJSON(&req); err != nil { service.Error(c, e.InvalidParams, err, err.Error()) return } data, err := service.GrpcArtistInfoUserImpl.UpdateRealNameAuditData(c, &req) if err != nil { fmt.Println("EditRealNameAudit: GrpcArtistInfoUserImpl.UpdateRealNameAuditData Error:" + err.Error()) service.ErrorWithMark(c, e.Failed, err, "EditRealNameAudit: GrpcArtistInfoUserImpl.UpdateRealNameAuditData Error:"+err.Error(), err.Error()) return } //发送短信通知 var auditResult string switch req.AuditStatus { case 2: auditResult = "通过" case 3: auditResult = "不通过" case 4: auditResult = "驳回" } if auditResult != "" { //老版本短信通知 //err = ArtistInfoPushNotice.RealNameAuditResultNotice(req.UserId, auditResult) //if err != nil { // logger.Errorf("画家宝实名短信通知失败:", err.Error()) //} appPusher := asPush.NewPusher() err = appPusher.RealNameAuditResultNotice(req.UserId, auditResult) if err != nil { logger.Errorf("画家宝实名短信通知失败:", err.Error()) } } //更新物理视图 //go asUser.DynamicUserService.UpdateUserWithUserId(int64(req.UserId)) service.Success(c, data) } func FakeLogin(c *gin.Context) { var jumpToWhere = "setting" var isDriverAuth = false var isDriverSupervisorAuth = false var req account.LoginRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { service.Error(c, e.InvalidParams, err) return } req.Ip = c.ClientIP() res, err := service.AccountProvider.Login(c, &req) if err != nil { service.Error(c, e.Error, err) return } accountInfo := &union.AccountInfo{ ID: res.AccountInfo.ID, Account: res.AccountInfo.Account, NickName: res.AccountInfo.NickName, Domain: res.AccountInfo.Domain, TelNum: res.AccountInfo.TelNum, Status: res.AccountInfo.Status, Avatar: res.AccountInfo.Avatar, CreatedAt: res.AccountInfo.CreateAt, IsNeedChange: res.AccountInfo.IsNeedChange, EnterDate: res.AccountInfo.EnterDate, WorkYear: res.AccountInfo.WorkYear, JumpTo: res.AccountInfo.Extend.JumpTo, DepartmentName: "", JobNum: res.AccountInfo.JobNum, BirthDate: res.AccountInfo.BirthDate, Age: res.AccountInfo.Age, Sex: res.AccountInfo.Sex, Title: res.AccountInfo.Title, IDNum: res.AccountInfo.IDNum, DriverAuth: isDriverAuth, DriverSupervisorAuth: isDriverSupervisorAuth, MailAccount: res.AccountInfo.MailAccount, Train: res.AccountInfo.Train, Certificate: res.AccountInfo.Certificate, TrainVideos: res.AccountInfo.TrainVideos, } code := "xxx" token, err := secret.CombineSecret(code, accountInfo.DepartmentName, res.Token) if err != nil { service.Error(c, e.Error, err) return } resInfo := &union.Login{ Token: token, RefreshToken: res.RefreshToken, AccountInfo: accountInfo, JumpToWhere: jumpToWhere, } fmt.Println("是否相同:", res.IsSampleAddress, res.AccountInfo.NowLogId) service.Success(c, resInfo) return }