package controllers import ( "encoding/json" "fmt" "hongze/hongze_cygx/models" "hongze/hongze_cygx/utils" "rdluck_tools/paging" "strconv" "time" ) //活动 type ActivityCoAntroller struct { BaseAuthController } // @Title 活动类型列表 // @Description活动类型列表接口 // @Success 200 {object} models.ActivityTypeListResp // @router /activityTypelist [get] func (this *ActivityCoAntroller) List() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,SysUser Is Empty" br.Ret = 408 return } resp := new(models.ActivityTypeListResp) list, err := models.GetActivityTypeList() if err != nil { br.Msg = "获取失败" br.ErrMsg = "获取数据失败,Err:" + err.Error() return } resp.List = list br.Ret = 200 br.Success = true br.Msg = "获取成功" br.Data = resp } // @Title 活动列表 // @Description 获取活动列表接口 // @Param PageSize query int true "每页数据条数" // @Param CurrentIndex query int true "当前页页码,从1开始" // @Param ChartPermissionIds query string false "行业id 多个用 , 隔开" // @Param ActivityTypeIds query string false "活动类型id 多个用 , 隔开" // @Param KeyWord query string false "搜索关键词" // @Param ActiveState query string false "活动进行状态 未开始:1、进行中2、已结束3" // @Param IsShowJurisdiction query int false "是否仅展示有权限的,1是,2否 默认为零" // @Success 200 {object} models.GetCygxActivityListRep // @router /list [get] func (this *ActivityCoAntroller) ActivityList() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,SysUser Is Empty" return } uid := user.UserId pageSize, _ := this.GetInt("PageSize") currentIndex, _ := this.GetInt("CurrentIndex") chartPermissionIds := this.GetString("ChartPermissionIds") activityTypeIds := this.GetString("ActivityTypeIds") isShowJurisdiction, _ := this.GetInt("IsShowJurisdiction") keyWord := this.GetString("KeyWord") activeState := this.GetString("ActiveState") if activeState == "" { activeState = "1" } //if isShowJurisdiction != 1 { // isShowJurisdiction = 0 //} itemSearch := new(models.CygxActivityUserSearchContent) itemSearch.UserId = uid itemSearch.CreateTime = time.Now() itemSearch.Mobile = user.Mobile itemSearch.Email = user.Email itemSearch.CompanyId = user.CompanyId itemSearch.CompanyName = user.CompanyName itemSearch.ModifyTime = time.Now() itemSearch.ChartPermissionids = chartPermissionIds itemSearch.ActivityTypeids = activityTypeIds itemSearch.ActiveState = activeState itemSearch.IsShowJurisdiction = isShowJurisdiction _, errSearch := models.AddUserSearchContent(itemSearch) if errSearch != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errSearch.Error() return } var startSize int if pageSize <= 0 { pageSize = utils.PageSize20 } if currentIndex <= 0 { currentIndex = 1 } startSize = utils.StartIndex(currentIndex, pageSize) var condition string var pars []interface{} if keyWord != "" { condition += ` AND (art.activity_name LIKE '%` + keyWord + `%' ) ` } //行业名称 if len(chartPermissionIds) > 0 { condition += ` AND art.chart_permission_id IN (` + chartPermissionIds + `)` } condition += ` AND art.publish_status = 1 AND art.active_state IN (` + activeState + `)` //1专家电话会、2分析师电话会、3公司调研电话会、4公司线下调研、5专家线下沙龙、6分析师线下沙龙 //resultTimeNow := time.Now().Format("2006-01-02 15:04:05") //resultTime30 := time.Now().Add(+time.Minute * 30).Format("2006-01-02 15:04:05") //resultTime_30 := time.Now().Add(-time.Minute * 30).Format("2006-01-02 15:04:05") //resultTime60 := time.Now().Add(+time.Minute * 60).Format("2006-01-02 15:04:05") //resultTime_60 := time.Now().Add(-time.Minute * 60).Format("2006-01-02 15:04:05") //if activeState == "1" { // if len(activityTypeIds) > 0 { // condition += ` AND art.activity_type_id IN (` + activityTypeIds + `)` // } // condition += ` AND art.activity_time > ` + "'" + resultTimeNow + "'" //} else if activeState == "2" { // condition += ` AND art.activity_time > ` + "'" + resultTimeNow + "'" // if len(activityTypeIds) > 0 { // condition += ` AND art.activity_type_id IN (` + activityTypeIds + `)` // condition += ` AND art.activity_time < ` + "'" + resultTime30 + "'" // } else { // var sqlOr string // sqlOr = condition // condition += ` AND (art.activity_type_id IN ( 1, 2, 3 ) AND art.activity_time < ` + "'" + resultTime30 + "'" + ")" // condition += ` OR(art.activity_type_id IN ( 4, 5, 6 ) AND art.activity_time < ` + "'" + resultTime60 + "'" + sqlOr + ")" // } //} else { // if len(activityTypeIds) > 0 { // condition += ` AND art.activity_type_id IN (` + activityTypeIds + `)` // condition += ` AND art.activity_time > ` + "'" + resultTime_30 + "'" // } else { // var sqlOr string // sqlOr = condition // condition += ` AND (art.activity_type_id IN ( 1, 2, 3 ) AND art.activity_time <` + "'" + resultTime_30 + "'" + ")" // condition += ` OR(art.activity_type_id IN ( 4, 5, 6 ) AND art.activity_time < ` + "'" + resultTime_60 + "'" + sqlOr + ")" // } //} total, err := models.GetActivityCount(condition, pars) if err != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + err.Error() return } if activeState != "1" { condition += ` ORDER BY art.activity_time DESC ` } //condition += ` ORDER BY art.activity_time DESC ` list, errList := models.GetActivityListAll(condition, pars, uid, startSize, pageSize) //srt30min := "1,2,3" //srt60min := "4,5,6" //for k, v := range list { // if strings.Contains(srt30min, strconv.Itoa(v.ActivityTypeId)) { // resultTime := utils.StrTimeToTime(v.ActivityTime) //时间字符串格式转时间格式 // if resultTime.After(time.Now()) { // list[k].ActiveState = "1" // } else if time.Now().After(resultTime) && resultTime.After(time.Now().Add(+time.Minute*30)) { // list[k].ActiveState = "2" // } else { // list[k].ActiveState = "3" // } // } // if strings.Contains(srt60min, strconv.Itoa(v.ActivityTypeId)) { // resultTime := utils.StrTimeToTime(v.ActivityTime) //时间字符串格式转时间格式 // if resultTime.After(time.Now()) { // list[k].ActiveState = "1" // } else if time.Now().After(resultTime) && resultTime.After(time.Now().Add(+time.Minute*60)) { // list[k].ActiveState = "2" // } else { // list[k].ActiveState = "3" // } // } //} if errList != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + errList.Error() return } page := paging.GetPaging(currentIndex, pageSize, total) resp := new(models.GetCygxActivityListRep) resp.List = list resp.Paging = page br.Ret = 200 br.Success = true br.Msg = "获取成功" br.Data = resp } // @Title 我的日程 // @Description 我的日程列表接口 // @Param PageSize query int true "每页数据条数" // @Param CurrentIndex query int true "当前页页码,从1开始" // @Success 200 {object} models.GetCygxActivityListRep // @router /scheduleList [get] func (this *ActivityCoAntroller) ScheduleList() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,SysUser Is Empty" return } uid := user.UserId pageSize, _ := this.GetInt("PageSize") currentIndex, _ := this.GetInt("CurrentIndex") var startSize int if pageSize <= 0 { pageSize = utils.PageSize20 } if currentIndex <= 0 { currentIndex = 1 } startSize = utils.StartIndex(currentIndex, pageSize) var condition string var pars []interface{} condition += ` AND art.publish_status = 1 AND art.active_state IN(1,2) AND s.is_cancel = 0 AND s.fail_type = 0 ` total, err := models.GetScheduleCount(condition, uid) if err != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + err.Error() return } list, errList := models.GetScheduleList(condition, pars, uid, startSize, pageSize) if errList != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + errList.Error() return } page := paging.GetPaging(currentIndex, pageSize, total) resp := new(models.GetCygxActivityListRep) resp.List = list resp.Paging = page br.Ret = 200 br.Success = true br.Msg = "获取成功" br.Data = resp } // @Title 活动详情 // @Description 获取活动详情接口 // @Param ActivityId query int true "活动ID" // @Success Ret=200 {object} models.ActivityDetail // @router /detail [get] func (this *ActivityCoAntroller) Detail() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,用户信息为空" br.Ret = 408 return } uid := user.UserId activityId, _ := this.GetInt("ActivityId") if activityId < 1 { br.Msg = "请输入活动ID" return } activityInfo, err := models.GetAddActivityInfoByIdShow(uid, activityId) if activityInfo == nil { br.Msg = "活动不存在" br.ErrMsg = "活动ID错误,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId) return } detail, errDetail := models.GetActivityTypeDetailById(activityInfo.ActivityTypeId) if errDetail != nil { br.Msg = "获取信息失败" br.ErrMsg = "获取信息失败,Err:" + errDetail.Error() return } activityInfo.ShowType = detail.ShowType br.Ret = 200 br.Success = true br.Msg = "获取成功" br.Data = activityInfo } // @Title 活动报名 // @Description 活动报名接口 // @Param request body models.ActivitySingnupRep true "type json string" // @Success Ret=200 {object} models.SignupStatus // @router /signup/add [post] func (this *ActivityCoAntroller) SignupAdd() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,用户信息为空" br.Ret = 408 return } uid := user.UserId //var signupStatus string signupStatus := "" var req models.ActivitySingnupRep err := json.Unmarshal(this.Ctx.Input.RequestBody, &req) if err != nil { br.Msg = "参数解析异常!" br.ErrMsg = "参数解析失败,Err:" + err.Error() return } activityId := req.ActivityId signupType := req.SignupType if signupType != 1 && signupType != 2 { br.Msg = "请选择正确的报名方式!" return } //SignupStatus string `description:"报名状态:人数已满:FullStarffed、单机构超过两人:TwoPeople、爽约次数过多:BreakPromise、超时:Overtime 、成功:Success"` item := new(models.CygxActivitySignup) //if activityId%5 == 1 { // signupStatus = "FullStarffed" // item.FailType = 1 //} else if activityId%5 == 2 { // signupStatus = "TwoPeople" // item.FailType = 2 //} else if activityId%5 == 3 { // signupStatus = "BreakPromise" // item.FailType = 3 //} else if activityId%5 == 4 { // signupStatus = "Overtime" //} else if activityId%5 == 5 { // signupStatus = "Success" //} signupStatus = "Success" activityInfo, errInfo := models.GetAddActivityInfoById(activityId) if activityInfo == nil { br.Msg = "操作失败" br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(activityId) return } if errInfo != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errInfo.Error() return } resultTime := utils.StrTimeToTime(activityInfo.ActivityTime) //时间字符串格式转时间格式 if time.Now().After(resultTime.Add(-time.Minute * 60)) { signupStatus = "Overtime" } total, errtotal := models.GetActivitySignupCount(uid, activityId) if errtotal != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + errtotal.Error() return } if total > 0 { br.Msg = "您已报名这个活动" return } if signupStatus == "Success" { item.UserId = uid item.ActivityId = activityId item.CreateTime = time.Now() item.Mobile = user.Mobile item.Email = user.Email item.CompanyId = user.CompanyId item.CompanyName = user.CompanyName _, errSignup := models.AddActivitySignup(item) if errSignup != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errSignup.Error() return } } resp := new(models.SignupStatus) resp.SignupType = signupType resp.SignupStatus = signupStatus if signupStatus == "Success" { resp.ActivityId = activityId } if activityId%2 == 1 { resp.GoFollow = true } br.Ret = 200 br.Success = true br.Msg = "操作成功" br.Data = resp } // @Title 活动取消报名 // @Description 活动取消报名接口 // @Param request body models.ActivitySingnupRep true "type json string" // @Success Ret=200 {object} models.SignupStatus // @router /signup/cancel [post] func (this *ActivityCoAntroller) SignupCancel() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,用户信息为空" br.Ret = 408 return } uid := user.UserId var req models.ActivitySingnupRep err := json.Unmarshal(this.Ctx.Input.RequestBody, &req) if err != nil { br.Msg = "参数解析异常!" br.ErrMsg = "参数解析失败,Err:" + err.Error() return } activityId := req.ActivityId signupType := req.SignupType if signupType != 1 && signupType != 2 { br.Msg = "请选择正确的报名方式!" return } item := new(models.CygxActivitySignup) activityInfo, errInfo := models.GetAddActivityInfoById(activityId) if activityInfo == nil { br.Msg = "操作失败" br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(activityId) return } if errInfo != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errInfo.Error() return } resultTime := utils.StrTimeToTime(activityInfo.ActivityTime) //时间字符串格式转时间格式 if time.Now().After(resultTime.Add(-time.Minute * 60)) { if signupType == 1 { br.Msg = "活动开始前1小时内无法取消预约外呼,请联系对口销售处理" } else { br.Msg = "活动开始前1小时内无法取消报名,请联系对口销售处理" } return } total, err := models.GetActivitySignupCount(uid, activityId) if err != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + err.Error() return } if total == 0 { br.Msg = "您暂未报名这个活动" return } item.UserId = uid item.ActivityId = activityId item.CreateTime = time.Now() item.Mobile = user.Mobile item.Email = user.Email item.CompanyId = user.CompanyId item.CompanyName = user.CompanyName resp := new(models.SignupStatus) resp.ActivityId = activityId _, errSignup := models.CancelActivitySignup(item) if errSignup != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errSignup.Error() return } br.Ret = 200 br.Success = true br.Msg = "操作成功" br.Data = resp } // @Title 用户搜索详情 // @Description 获取用户搜索详情接口 // @Param IsShowJurisdiction query int true "是否仅展示有权限的,默认为0,1是,2否 " // @Success Ret=200 {object} models.ActivityUserSearchContentList // @router /getUserSearchContent [get] func (this *ActivityCoAntroller) GetUserSearchContent() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,用户信息为空" br.Ret = 408 return } uid := user.UserId detailSeearch := new(models.CygxActivityUserSearchContent) detailSeearch.IsShowJurisdiction = 0 detailSeearch.ChartPermissionids = "" detailSeearch.ActiveState = "" detail, _ := models.GetUserSearchContentByUid(uid) if detail == nil { detail = detailSeearch } //if err != nil { // br.Msg = "获取信息失败" // br.ErrMsg = "获取信息失败,Err:" + err.Error() // return //} isShowJurisdiction, _ := this.GetInt("IsShowJurisdiction") //chartPermissionidsSlice := strings.Split(detail.ChartPermissionids, ",") //activityTypeidsSlice := strings.Split(detail.ActivityTypeids, ",") //activeStateSlice := strings.Split(detail.ActiveState, ",") //"活动进行状态 未开始:1、进行中2、已结束3"` listActivityType, errActivityType := models.GetActivityTypeList() if errActivityType != nil { br.Msg = "获取失败" br.ErrMsg = "获取数据失败,Err:" + errActivityType.Error() return } //for _, v := range activityTypeidsSlice { // for k2, v2 := range listActivityType { // if strconv.Itoa(v2.ActivityTypeId) == v { // listActivityType[k2].IsChoose = true // } // } //} var listChartPermissionid []*models.ActivityChartPermission var errChart error if isShowJurisdiction == 1 { listChartPermissionidAll, errChartAll := models.GetUserCompanyPermission(user.CompanyId) listChartPermissionid = listChartPermissionidAll errChart = errChartAll } else if isShowJurisdiction == 2 { listChartPermissionidAll, errChartAll := models.GetChartPermissionActivity() listChartPermissionid = listChartPermissionidAll errChart = errChartAll } else { if detail.IsShowJurisdiction == 1 { listChartPermissionidAll, errChartAll := models.GetUserCompanyPermission(user.CompanyId) listChartPermissionid = listChartPermissionidAll errChart = errChartAll } else { listChartPermissionidAll, errChartAll := models.GetChartPermissionActivity() listChartPermissionid = listChartPermissionidAll errChart = errChartAll } } if errChart != nil { br.Msg = "获取信息失败" br.ErrMsg = "获取品种信息失败,Err:" + errChart.Error() return } //for _, v := range chartPermissionidsSlice { // for k2, v2 := range listChartPermissionid { // if strconv.Itoa(v2.ChartPermissionId) == v { // listChartPermissionid[k2].IsChoose = true // } // } //} resp := new(models.ActivityUserSearchContentList) if detail.IsShowJurisdiction == 1 { resp.IsShowJurisdiction = true } fmt.Println(isShowJurisdiction) if isShowJurisdiction == 1 || detail.IsShowJurisdiction == 1 { resp.IsShowJurisdiction = true for k, _ := range listChartPermissionid { listChartPermissionid[k].IsChoose = true } } if isShowJurisdiction == 2 { resp.IsShowJurisdiction = false } activeStateList := []models.ActivityStaus{models.ActivityStaus{Id: 1, StatusName: "未开始"}, models.ActivityStaus{Id: 2, StatusName: "进行中"}, models.ActivityStaus{Id: 3, StatusName: "已结束"}} //for _, v := range activeStateSlice { // for k2, v2 := range activeStateList { // if strconv.Itoa(v2.Id) == v { // //activeStateList[k2].IsChoose = true // } // } //} if activeStateList[1].IsChoose == activeStateList[2].IsChoose == false { activeStateList[0].IsChoose = true } resp.ListActivityType = listActivityType resp.ListChartPermission = listChartPermissionid resp.ListActivityStaus = activeStateList br.Ret = 200 br.Success = true br.Msg = "获取成功" br.Data = resp } // @Title 添加会议提醒 // @Description 添加会议提醒接口 // @Param request body models.ActivityIdRep true "type json string" // @Success Ret=200 {object} models.SignupStatus // @router /meetingReminder/add [post] func (this *ActivityCoAntroller) MeetingReminderAdd() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,用户信息为空" br.Ret = 408 return } uid := user.UserId //var signupStatus string signupStatus := "Success" var req models.ActivityIdRep err := json.Unmarshal(this.Ctx.Input.RequestBody, &req) if err != nil { br.Msg = "参数解析异常!" br.ErrMsg = "参数解析失败,Err:" + err.Error() return } activityId := req.ActivityId //SignupStatus string `description:"报名状态:人数已满:FullStarffed、单机构超过两人:TwoPeople、爽约次数过多:BreakPromise、超时:Overtime 、成功:Success"` item := new(models.CygxActivityMeetingReminder) activityInfo, errInfo := models.GetAddActivityInfoById(activityId) if activityInfo == nil { br.Msg = "操作失败" br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(activityId) return } if errInfo != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errInfo.Error() return } resultTime := utils.StrTimeToTime(activityInfo.ActivityTime) //时间字符串格式转时间格式 if time.Now().After(resultTime.Add(-time.Minute * 15)) { br.Msg = "活动开始前15分钟无法设置会议提醒" return } //if signupStatus == "Success" { total, err := models.GetActivitySignupCount(uid, activityId) if err != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + err.Error() return } if total == 0 { br.Msg = "您暂未预约外呼这个活动" return } totalMeeting, errMeeting := models.GetActivityMeetingReminderCount(uid, activityId) if errMeeting != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + errMeeting.Error() return } if totalMeeting > 0 { br.Msg = "您已预约,请勿重复预约" return } item.UserId = uid item.ActivityId = activityId item.CreateTime = time.Now() item.Mobile = user.Mobile item.Email = user.Email item.CompanyId = user.CompanyId item.CompanyName = user.CompanyName _, errSignup := models.AddActivityMeetingReminder(item) if errSignup != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errSignup.Error() return } //} resp := new(models.SignupStatus) resp.SignupStatus = signupStatus resp.ActivityId = activityId if activityId%2 == 1 { resp.GoFollow = true } br.Ret = 200 br.Success = true br.Msg = "设置成功,会前15分钟会为您推送微信消息提醒" br.Data = resp } // @Title 取消会议提醒 // @Description 取消会议提醒接口 // @Param request body models.ActivityIdRep true "type json string" // @Success Ret=200 {object} models.SignupStatus // @router /meetingReminder/cancel [post] func (this *ActivityCoAntroller) MeetingReminderCancel() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() user := this.User if user == nil { br.Msg = "请登录" br.ErrMsg = "请登录,用户信息为空" br.Ret = 408 return } uid := user.UserId var req models.ActivityIdRep err := json.Unmarshal(this.Ctx.Input.RequestBody, &req) if err != nil { br.Msg = "参数解析异常!" br.ErrMsg = "参数解析失败,Err:" + err.Error() return } activityId := req.ActivityId signupStatus := "Success" item := new(models.CygxActivityMeetingReminder) activityInfo, errInfo := models.GetAddActivityInfoById(activityId) if activityInfo == nil { br.Msg = "操作失败" br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(activityId) return } if errInfo != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errInfo.Error() return } //if signupStatus == "Success" { total, err := models.GetActivityMeetingReminderCount(uid, activityId) if err != nil { br.Msg = "获取失败" br.ErrMsg = "获取失败,Err:" + err.Error() return } if total == 0 { br.Msg = "您暂未添加该活动会议提醒" return } resultTime := utils.StrTimeToTime(activityInfo.ActivityTime) //时间字符串格式转时间格式 if time.Now().After(resultTime.Add(-time.Minute * 15)) { br.Msg = "活动开始前15分钟无法取消会议提醒" return } item.UserId = uid item.ActivityId = activityId item.CreateTime = time.Now() item.Mobile = user.Mobile item.Email = user.Email item.CompanyId = user.CompanyId item.CompanyName = user.CompanyName _, errSignup := models.CancelActivityMeetingReminder(item) if errSignup != nil { br.Msg = "操作失败" br.ErrMsg = "操作失败,Err:" + errSignup.Error() return } //} resp := new(models.SignupStatus) resp.SignupStatus = signupStatus resp.ActivityId = activityId br.Ret = 200 br.Success = true br.Msg = "操作成功" br.Data = resp }