add apis
CI / changes (push) Successful in 1m30s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / aiserver (push) Successful in 0s
CI / analysis (push) Successful in 0s
CI / bff (push) Successful in 28s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 1s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 1s
CI / order (push) Successful in 0s
CI / payment (push) Successful in 1s
CI / percutaneous (push) Successful in 0s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / store (push) Successful in 0s
CI / support (push) Successful in 0s
CI / task (push) Successful in 1s
CI / user (push) Successful in 0s
CI / water (push) Successful in 28s
CI / wecom (push) Successful in 0s
CI / ws (push) Successful in 0s
CI / changes (push) Successful in 1m30s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / aiserver (push) Successful in 0s
CI / analysis (push) Successful in 0s
CI / bff (push) Successful in 28s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 1s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 1s
CI / order (push) Successful in 0s
CI / payment (push) Successful in 1s
CI / percutaneous (push) Successful in 0s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / store (push) Successful in 0s
CI / support (push) Successful in 0s
CI / task (push) Successful in 1s
CI / user (push) Successful in 0s
CI / water (push) Successful in 28s
CI / wecom (push) Successful in 0s
CI / ws (push) Successful in 0s
This commit is contained in:
+25
-21
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v4.25.8
|
||||
// protoc-gen-go v1.36.12
|
||||
// protoc v3.19.4
|
||||
// source: water/water.proto
|
||||
|
||||
package water
|
||||
@@ -924,7 +924,8 @@ const file_water_water_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"use_number\x18\x05 \x01(\x05R\tuseNumber\x12\x16\n" +
|
||||
"\x06soften\x18\x06 \x01(\x05R\x06soften\x12#\n" +
|
||||
"\rno_disturbing\x18\a \x01(\tR\fnoDisturbing2\xfd\t\n" +
|
||||
"\rno_disturbing\x18\a \x01(\tR\fnoDisturbing2\xdc\n" +
|
||||
"\n" +
|
||||
"\x05Water\x12Z\n" +
|
||||
"\tWifiCheck\x12\x17.water.WifiCheckRequest\x1a\x0f.water.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\x12\x18/api/v3/water/wifi/check\x12T\n" +
|
||||
"\aWifiSet\x12\x15.water.WifiSetRequest\x1a\x0f.water.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/api/v3/water/wifi/set\x12Q\n" +
|
||||
@@ -941,7 +942,8 @@ const file_water_water_proto_rawDesc = "" +
|
||||
"\rWarningStatus\x12\x1b.water.WarningStatusRequest\x1a\x0f.water.Response\"'\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/api/v3/water/warning/status\x12U\n" +
|
||||
"\tApplyUser\x12\x17.water.ApplyUserRequest\x1a\x0f.water.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/api/v3/water/apply\x12`\n" +
|
||||
"\vApplyStatus\x12\x19.water.ApplyStatusRequest\x1a\x0f.water.Response\"%\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/api/v3/water/apply/status\x12`\n" +
|
||||
"\vchangeAdmin\x12\x19.water.changeAdminRequest\x1a\x0f.water.Response\"%\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/api/v3/water/change/admin\x12M\n" +
|
||||
"\vchangeAdmin\x12\x19.water.changeAdminRequest\x1a\x0f.water.Response\"%\x82\xd3\xe4\x93\x02\x1f:\x01*\"\x1a/api/v3/water/change/admin\x12]\n" +
|
||||
"\x0fUsersApplyItems\x12\x13.water.UsersRequest\x1a\x0f.water.Response\"$\x82\xd3\xe4\x93\x02\x1e:\x01*\x12\x19/api/v3/water/users/apply\x12M\n" +
|
||||
"\x05Users\x12\x13.water.UsersRequest\x1a\x0f.water.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/api/v3/water/usersB\tZ\a./waterb\x06proto3"
|
||||
|
||||
var (
|
||||
@@ -988,23 +990,25 @@ var file_water_water_proto_depIdxs = []int32{
|
||||
12, // 10: water.Water.ApplyUser:input_type -> water.ApplyUserRequest
|
||||
13, // 11: water.Water.ApplyStatus:input_type -> water.ApplyStatusRequest
|
||||
10, // 12: water.Water.changeAdmin:input_type -> water.changeAdminRequest
|
||||
11, // 13: water.Water.Users:input_type -> water.UsersRequest
|
||||
5, // 14: water.Water.WifiCheck:output_type -> water.Response
|
||||
5, // 15: water.Water.WifiSet:output_type -> water.Response
|
||||
5, // 16: water.Water.AddLog:output_type -> water.Response
|
||||
5, // 17: water.Water.LogItems:output_type -> water.Response
|
||||
5, // 18: water.Water.Setting:output_type -> water.Response
|
||||
5, // 19: water.Water.GetSetting:output_type -> water.Response
|
||||
5, // 20: water.Water.GetWaterInfo:output_type -> water.Response
|
||||
5, // 21: water.Water.GetWarning:output_type -> water.Response
|
||||
5, // 22: water.Water.AddWarning:output_type -> water.Response
|
||||
5, // 23: water.Water.WarningStatus:output_type -> water.Response
|
||||
5, // 24: water.Water.ApplyUser:output_type -> water.Response
|
||||
5, // 25: water.Water.ApplyStatus:output_type -> water.Response
|
||||
5, // 26: water.Water.changeAdmin:output_type -> water.Response
|
||||
5, // 27: water.Water.Users:output_type -> water.Response
|
||||
14, // [14:28] is the sub-list for method output_type
|
||||
0, // [0:14] is the sub-list for method input_type
|
||||
11, // 13: water.Water.UsersApplyItems:input_type -> water.UsersRequest
|
||||
11, // 14: water.Water.Users:input_type -> water.UsersRequest
|
||||
5, // 15: water.Water.WifiCheck:output_type -> water.Response
|
||||
5, // 16: water.Water.WifiSet:output_type -> water.Response
|
||||
5, // 17: water.Water.AddLog:output_type -> water.Response
|
||||
5, // 18: water.Water.LogItems:output_type -> water.Response
|
||||
5, // 19: water.Water.Setting:output_type -> water.Response
|
||||
5, // 20: water.Water.GetSetting:output_type -> water.Response
|
||||
5, // 21: water.Water.GetWaterInfo:output_type -> water.Response
|
||||
5, // 22: water.Water.GetWarning:output_type -> water.Response
|
||||
5, // 23: water.Water.AddWarning:output_type -> water.Response
|
||||
5, // 24: water.Water.WarningStatus:output_type -> water.Response
|
||||
5, // 25: water.Water.ApplyUser:output_type -> water.Response
|
||||
5, // 26: water.Water.ApplyStatus:output_type -> water.Response
|
||||
5, // 27: water.Water.changeAdmin:output_type -> water.Response
|
||||
5, // 28: water.Water.UsersApplyItems:output_type -> water.Response
|
||||
5, // 29: water.Water.Users:output_type -> water.Response
|
||||
15, // [15:30] is the sub-list for method output_type
|
||||
0, // [0:15] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v4.25.8
|
||||
// - protoc v3.19.4
|
||||
// source: water/water.proto
|
||||
|
||||
package water
|
||||
@@ -32,6 +32,7 @@ const (
|
||||
Water_ApplyUser_FullMethodName = "/water.Water/ApplyUser"
|
||||
Water_ApplyStatus_FullMethodName = "/water.Water/ApplyStatus"
|
||||
Water_ChangeAdmin_FullMethodName = "/water.Water/changeAdmin"
|
||||
Water_UsersApplyItems_FullMethodName = "/water.Water/UsersApplyItems"
|
||||
Water_Users_FullMethodName = "/water.Water/Users"
|
||||
)
|
||||
|
||||
@@ -59,6 +60,7 @@ type WaterClient interface {
|
||||
ApplyStatus(ctx context.Context, in *ApplyStatusRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
// 转移管理人
|
||||
ChangeAdmin(ctx context.Context, in *ChangeAdminRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
UsersApplyItems(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
// 管理人列表
|
||||
Users(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
@@ -201,6 +203,16 @@ func (c *waterClient) ChangeAdmin(ctx context.Context, in *ChangeAdminRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *waterClient) UsersApplyItems(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Water_UsersApplyItems_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *waterClient) Users(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
@@ -235,6 +247,7 @@ type WaterServer interface {
|
||||
ApplyStatus(context.Context, *ApplyStatusRequest) (*Response, error)
|
||||
// 转移管理人
|
||||
ChangeAdmin(context.Context, *ChangeAdminRequest) (*Response, error)
|
||||
UsersApplyItems(context.Context, *UsersRequest) (*Response, error)
|
||||
// 管理人列表
|
||||
Users(context.Context, *UsersRequest) (*Response, error)
|
||||
mustEmbedUnimplementedWaterServer()
|
||||
@@ -286,6 +299,9 @@ func (UnimplementedWaterServer) ApplyStatus(context.Context, *ApplyStatusRequest
|
||||
func (UnimplementedWaterServer) ChangeAdmin(context.Context, *ChangeAdminRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangeAdmin not implemented")
|
||||
}
|
||||
func (UnimplementedWaterServer) UsersApplyItems(context.Context, *UsersRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UsersApplyItems not implemented")
|
||||
}
|
||||
func (UnimplementedWaterServer) Users(context.Context, *UsersRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Users not implemented")
|
||||
}
|
||||
@@ -544,6 +560,24 @@ func _Water_ChangeAdmin_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Water_UsersApplyItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UsersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WaterServer).UsersApplyItems(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Water_UsersApplyItems_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WaterServer).UsersApplyItems(ctx, req.(*UsersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Water_Users_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UsersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -621,6 +655,10 @@ var Water_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "changeAdmin",
|
||||
Handler: _Water_ChangeAdmin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UsersApplyItems",
|
||||
Handler: _Water_UsersApplyItems_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Users",
|
||||
Handler: _Water_Users_Handler,
|
||||
|
||||
Binary file not shown.
@@ -182,6 +182,13 @@ service Water {
|
||||
};
|
||||
}
|
||||
|
||||
rpc UsersApplyItems(UsersRequest) returns (Response) {
|
||||
option (google.api.http) = {
|
||||
get: "/api/v3/water/users/apply"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
// 管理人列表
|
||||
rpc Users(UsersRequest) returns (Response) {
|
||||
option (google.api.http) = {
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/services/water/internal/dao"
|
||||
"lone-services/services/water/model"
|
||||
"lone-services/services/water/validator"
|
||||
|
||||
"lone-services/rpc/water/pb"
|
||||
"lone-services/services/water/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UsersApplyItemsLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
BaseLogic
|
||||
}
|
||||
|
||||
func NewUsersApplyItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UsersApplyItemsLogic {
|
||||
return &UsersApplyItemsLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UsersApplyItemsLogic) UsersApplyItems(in *water.UsersRequest) (*water.Response, error) {
|
||||
var v validator.UserItemsValidator
|
||||
if fail := l.checkParams(in, &v); fail != nil {
|
||||
return fail, nil
|
||||
}
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
|
||||
w := modelbase.Params{Eq: map[string]string{"host_code": in.HostCode, "status": utils.StatusForbiddenString}}
|
||||
|
||||
var info []dao.UsersInfo
|
||||
items, err := model.UsersModel{}.Init().Page(w, &info)
|
||||
if err != nil {
|
||||
return l.fail(utils.Fail)
|
||||
}
|
||||
|
||||
return l.ok(items)
|
||||
}
|
||||
@@ -95,6 +95,11 @@ func (s *WaterServer) ChangeAdmin(ctx context.Context, in *water.ChangeAdminRequ
|
||||
return l.ChangeAdmin(in)
|
||||
}
|
||||
|
||||
func (s *WaterServer) UsersApplyItems(ctx context.Context, in *water.UsersRequest) (*water.Response, error) {
|
||||
l := logic.NewUsersApplyItemsLogic(ctx, s.svcCtx)
|
||||
return l.UsersApplyItems(in)
|
||||
}
|
||||
|
||||
// 管理人列表
|
||||
func (s *WaterServer) Users(ctx context.Context, in *water.UsersRequest) (*water.Response, error) {
|
||||
l := logic.NewUsersLogic(ctx, s.svcCtx)
|
||||
|
||||
@@ -51,6 +51,7 @@ type (
|
||||
ApplyStatus(ctx context.Context, in *ApplyStatusRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
// 转移管理人
|
||||
ChangeAdmin(ctx context.Context, in *ChangeAdminRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
UsersApplyItems(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
// 管理人列表
|
||||
Users(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
@@ -138,6 +139,11 @@ func (m *defaultWater) ChangeAdmin(ctx context.Context, in *ChangeAdminRequest,
|
||||
return client.ChangeAdmin(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultWater) UsersApplyItems(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := water.NewWaterClient(m.cli.Conn())
|
||||
return client.UsersApplyItems(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 管理人列表
|
||||
func (m *defaultWater) Users(ctx context.Context, in *UsersRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := water.NewWaterClient(m.cli.Conn())
|
||||
|
||||
Reference in New Issue
Block a user