12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package logic
- import (
- "context"
- "jyBXCore/rpc/type/bxcore"
- "net/http"
- "jyBXCore/api/internal/svc"
- "jyBXCore/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type ParticipateSetUpInfoLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- r *http.Request
- }
- func NewParticipateSetUpInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateSetUpInfoLogic {
- return &ParticipateSetUpInfoLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- r: r,
- }
- }
- func (l *ParticipateSetUpInfoLogic) ParticipateSetUpInfo(req *types.ParticipateSetUpInfoReq) (resp *types.CommonResp, err error) {
- var (
- bidType []*bxcore.BidTypeReq
- remindRule []*bxcore.RemindRuleReq
- )
- if req.SetAction != "" {
- if len(req.BidType) > 0 {
- for _, v := range req.BidType {
- bidType = append(bidType, &bxcore.BidTypeReq{
- Name: v.Name,
- Content: v.Content,
- })
- }
- }
- if len(req.RemindRule) > 0 {
- for _, v := range req.RemindRule {
- remindRule = append(remindRule, &bxcore.RemindRuleReq{
- BidState: v.BidState,
- Remainder: v.Remainder,
- Node: v.Node,
- })
- }
- }
- }
- res, err := l.svcCtx.BxCore.ParticipateSetUpInfo(l.ctx, &bxcore.ParticipateSetUpInfoReq{
- EntId: req.EntId,
- EntUserId: req.EntUserId,
- PositionId: req.PositionId,
- PositionType: req.PositionType,
- AppId: req.AppId,
- UserId: req.UserId,
- NewUserId: req.NewUserId,
- AccountId: req.AccountId,
- SetAction: req.SetAction,
- IsAllow: req.IsAllow,
- BidType: bidType,
- RemindRule: remindRule,
- EntAccountId: req.EntAccountId,
- Phone: req.Phone,
- })
- if err != nil {
- return &types.CommonResp{
- Err_code: -1,
- Err_msg: "操作失败",
- Data: false,
- }, nil
- }
- return &types.CommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: res.Data,
- }, nil
- }
|