123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package logic
- import (
- "app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
- "context"
- "app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/svc"
- "app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenter"
- "github.com/tal-tech/go-zero/core/logx"
- )
- type UseUserDetailedLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewUseUserDetailedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UseUserDetailedLogic {
- return &UseUserDetailedLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 根据账户标识使用资源
- func (l *UseUserDetailedLogic) UseUserDetailed(in *resourcesCenter.Resources) (*resourcesCenter.UseUserResponse, error) {
- // todo: add your logic here and delete this line
- balance := &resourcesCenter.Balance{
- AccountId: in.AccountId,
- CompanyId: in.CompanyId,
- DepartmentId: in.DepartmentId,
- Name: in.Name,
- ResourceType: in.ResourceType,
- Number: in.Number,
- Spec: in.Spec,
- AppId: in.AppId,
- Model: in.Model,
- EndTime: in.EndTime,
- }
- detailed := &resourcesCenter.Detailed{
- AccountId: in.AccountId,
- CompanyId: in.CompanyId,
- ResourceType: in.ResourceType,
- Number: in.Number,
- DepartmentId: in.DepartmentId,
- Name: in.Name,
- UserId: in.UserId,
- UserType: in.Model,
- Remarks: in.Remarks,
- RuleId: in.RuleId,
- }
- code, msg, deductionNumb := balanceService.UseUserDetailed(in.DuplicateRemoval, balance, detailed, in.InfoId, config.ConfigJson.DedupUrl)
- return &resourcesCenter.UseUserResponse{
- Code: code,
- Message: msg,
- DeductionNumb: deductionNumb,
- }, nil
- }
|