add and fix apis
CI / changes (push) Successful in 1m33s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / analysis (push) Successful in 1s
CI / bff (push) Successful in 0s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 1s
CI / message (push) Successful in 0s
CI / order (push) Successful in 1s
CI / payment (push) Successful in 0s
CI / percutaneous (push) Successful in 31s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / store (push) Successful in 1s
CI / support (push) Successful in 0s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / water (push) Successful in 0s
CI / wecom (push) Successful in 0s
CI / ws (push) Successful in 0s
CI / changes (push) Successful in 1m33s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / analysis (push) Successful in 1s
CI / bff (push) Successful in 0s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 1s
CI / message (push) Successful in 0s
CI / order (push) Successful in 1s
CI / payment (push) Successful in 0s
CI / percutaneous (push) Successful in 31s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / store (push) Successful in 1s
CI / support (push) Successful in 0s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / water (push) Successful in 0s
CI / wecom (push) Successful in 0s
CI / ws (push) Successful in 0s
This commit is contained in:
@@ -2,13 +2,13 @@ package logic
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"lone-services/pkg/modelbase"
|
||||||
"lone-services/pkg/utils"
|
"lone-services/pkg/utils"
|
||||||
|
"lone-services/rpc/percutaneous/pb"
|
||||||
"lone-services/services/percutaneous/internal/dao"
|
"lone-services/services/percutaneous/internal/dao"
|
||||||
"lone-services/services/percutaneous/internal/model"
|
"lone-services/services/percutaneous/internal/model"
|
||||||
"lone-services/services/percutaneous/validator"
|
|
||||||
|
|
||||||
"lone-services/rpc/percutaneous/pb"
|
|
||||||
"lone-services/services/percutaneous/internal/svc"
|
"lone-services/services/percutaneous/internal/svc"
|
||||||
|
"lone-services/services/percutaneous/validator"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
)
|
)
|
||||||
@@ -33,9 +33,16 @@ func (l *UseLogic) Use(in *percutaneous.UseRequest) (*percutaneous.Response, err
|
|||||||
if fail := l.checkParams(in, &v); fail != nil {
|
if fail := l.checkParams(in, &v); fail != nil {
|
||||||
return fail, nil
|
return fail, nil
|
||||||
}
|
}
|
||||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
|
||||||
if adminInfo.ID < utils.NumberOne {
|
w := modelbase.Params{
|
||||||
return l.fail(utils.ErrorNoLoginInfo)
|
Eq: map[string]string{
|
||||||
|
"host_code": in.HostCode,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
var hostInfo dao.Group
|
||||||
|
err := model.GroupModel{}.Init().GetOne(w, &hostInfo)
|
||||||
|
if err != nil {
|
||||||
|
return l.fail(utils.Fail)
|
||||||
}
|
}
|
||||||
|
|
||||||
stamp, err := utils.ParseCustomTime(in.Stamp)
|
stamp, err := utils.ParseCustomTime(in.Stamp)
|
||||||
@@ -43,7 +50,7 @@ func (l *UseLogic) Use(in *percutaneous.UseRequest) (*percutaneous.Response, err
|
|||||||
return l.fail(utils.Fail)
|
return l.fail(utils.Fail)
|
||||||
}
|
}
|
||||||
info := dao.UsedLog{
|
info := dao.UsedLog{
|
||||||
HostUserId: adminInfo.ID,
|
HostUserId: hostInfo.HostUserId,
|
||||||
HostCode: in.HostCode,
|
HostCode: in.HostCode,
|
||||||
UserId: in.UserId,
|
UserId: in.UserId,
|
||||||
Data: in.Data,
|
Data: in.Data,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func NewWsClientStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ws
|
|||||||
|
|
||||||
func (l *WsClientStatusLogic) WsClientStatus(in *percutaneous.GetWsCodeRequest) (*percutaneous.Response, error) {
|
func (l *WsClientStatusLogic) WsClientStatus(in *percutaneous.GetWsCodeRequest) (*percutaneous.Response, error) {
|
||||||
Type := WsTypeApp
|
Type := WsTypeApp
|
||||||
|
|
||||||
//1为web,2为设备
|
//1为web,2为设备
|
||||||
if in.Type == utils.NumberOne {
|
if in.Type == utils.NumberOne {
|
||||||
Type = WsTypeOperation
|
Type = WsTypeOperation
|
||||||
|
|||||||
Reference in New Issue
Block a user