12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package logic
- import (
- "context"
- "fmt"
- "points_service/entity"
- "points_service/rpc/integral"
- "points_service/rpc/internal/svc"
- "github.com/tal-tech/go-zero/core/logx"
- )
- type IntegralHarvestLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewIntegralHarvestLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IntegralHarvestLogic {
- return &IntegralHarvestLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 收获积分
- func (l *IntegralHarvestLogic) IntegralHarvest(in *integral.AddReq) (*integral.AddResp, error) {
- dat := entity.FlowJSON{}
- dat.PointType = 1
- dat.BusinessTypeId = 1
- dat.BusinessType = "1"
- dat.EndDate = "2021-03-10"
- dat.AppId = 10000
- dat.OperationType = false
- dat.UserId=in.UserId
- dat.Point=in.CountPoints
- code, msg := integralService.IntegralAddService(dat)
- fmt.Println(code,msg)
- if (code == 1) {
- return &integral.AddResp{
- Status: true,
- Msg: msg,
- }, nil
- } else {
- return &integral.AddResp{
- Status: false,
- Msg: msg,
- }, nil
- }
- }
|