1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package logic
- import (
- "context"
- "fmt"
- "bp.jydev.jianyu360.cn/BaseService/resourceCenter/api/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/resourceCenter/api/internal/types"
- . "bp.jydev.jianyu360.cn/BaseService/resourceCenter/public/service"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type HaspowersLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewHaspowersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *HaspowersLogic {
- return &HaspowersLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *HaspowersLogic) Haspowers(req *types.Req) (resp *types.Reply, err error) {
- resp = &types.Reply{}
- if req.AppId == "" {
- resp.Error_msg = "无效的参数appid"
- l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
- return resp, nil
- } else if req.User_id == 0 && req.Ent_id == 0 && req.Ent_user_id == 0 {
- resp.Error_msg = "无效的参数user_id、ent_id、ent_user_id"
- l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
- return resp, nil
- }
- resp.Error_code = 0
- resp.Data = HasPowers(req.AppId, req.User_id, req.Ent_id, req.Ent_user_id)
- return
- }
|