sync: 对齐小程序 v1.0.2 生产代码并脱敏
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"strings"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-app/api/app/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/library/allocaterequest"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/library/contexts"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/service/executionlog"
|
||||
)
|
||||
|
||||
type AllocateResultController struct{}
|
||||
|
||||
func (c *AllocateResultController) Result(ctx context.Context, req *v1.AllocateResultReq) (*v1.AllocateResultRes, error) {
|
||||
batchNo := strings.TrimSpace(req.BatchNo)
|
||||
if batchNo == "" {
|
||||
batch, err := allocaterequest.Find(ctx, contexts.GetTenantId(ctx), contexts.GetUserId(ctx), req.RequestId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if batch == nil {
|
||||
return nil, gerror.New("划拨批次不存在或无权查看")
|
||||
}
|
||||
batchNo = batch.BatchNo
|
||||
}
|
||||
item, err := executionlog.AllocateSummary(ctx, batchNo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.AllocateResultRes{AppExecutionLogItem: item}, nil
|
||||
}
|
||||
func (c *AllocateResultController) Details(ctx context.Context, req *v1.AllocateDetailsReq) (*v1.AllocateDetailsRes, error) {
|
||||
items, total, err := executionlog.AllocateDetails(ctx, &req.AppExecutionLogDetailParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.AllocateDetailsRes{Items: items, Total: total}, nil
|
||||
}
|
||||
@@ -57,6 +57,14 @@ func (c *ControllerV1) PhoneLogin(ctx context.Context, req *v1.PhoneLoginReq) (r
|
||||
return &v1.PhoneLoginRes{AppAuthTokenModel: *token}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) PhoneSmsLogin(ctx context.Context, req *v1.PhoneSmsLoginReq) (res *v1.PhoneSmsLoginRes, err error) {
|
||||
token, err := service.AppAuth().PhoneSmsLogin(ctx, &req.AppPhoneSmsLoginParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.PhoneSmsLoginRes{AppAuthTokenModel: *token}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) WechatLogin(ctx context.Context, req *v1.WechatLoginReq) (res *v1.WechatLoginRes, err error) {
|
||||
data, err := service.AppAuth().WechatLogin(ctx, &req.AppWechatLoginParam)
|
||||
if err != nil {
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
)
|
||||
|
||||
func (c *ControllerV1) CustomerList(ctx context.Context, req *v1.CustomerListReq) (res *v1.CustomerListRes, err error) {
|
||||
items, total, err := service.AppUser().CustomerList(ctx, &req.AppCustomerListParam)
|
||||
items, total, summary, err := service.AppUser().CustomerList(ctx, &req.AppCustomerListParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.CustomerListRes{Items: items, Total: total}, nil
|
||||
return &v1.CustomerListRes{Items: items, Total: total, Summary: summary}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) CustomerDetail(ctx context.Context, req *v1.CustomerDetailReq) (res *v1.CustomerDetailRes, err error) {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-app/api/app/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) WarningPreference(ctx context.Context, req *v1.WarningPreferenceReq) (*v1.WarningPreferenceRes, error) {
|
||||
data, err := service.AppUser().WarningPreference(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.WarningPreferenceRes{AppWarningPreferenceModel: *data}, nil
|
||||
}
|
||||
func (c *ControllerV1) SaveWarningPreference(ctx context.Context, req *v1.SaveWarningPreferenceReq) (*v1.SaveWarningPreferenceRes, error) {
|
||||
data, err := service.AppUser().SaveWarningPreference(ctx, &req.AppWarningPreferenceParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.SaveWarningPreferenceRes{AppWarningPreferenceModel: *data}, nil
|
||||
}
|
||||
func (c *ControllerV1) UnbindWechat(ctx context.Context, req *v1.UnbindWechatReq) (*v1.UnbindWechatRes, error) {
|
||||
data, err := service.AppUser().UnbindWechat(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.UnbindWechatRes{AppWechatBindModel: *data}, nil
|
||||
}
|
||||
@@ -38,3 +38,10 @@ func (c *ControllerV1) WorkOrderUpload(ctx context.Context, req *v1.WorkOrderUpl
|
||||
}
|
||||
return &v1.WorkOrderUploadRes{SysOssUploadModel: workOrderFile}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) WorkOrderAction(ctx context.Context, req *v1.WorkOrderActionReq) (*v1.WorkOrderActionRes, error) {
|
||||
if err := service.AppWorkOrder().Action(ctx, &req.AppWorkOrderActionParam); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.WorkOrderActionRes{}, nil
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-app/api/app/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/service/executionlog"
|
||||
)
|
||||
|
||||
type ExecutionLogController struct{}
|
||||
|
||||
func (c *ExecutionLogController) List(ctx context.Context, req *v1.ExecutionLogListReq) (*v1.ExecutionLogListRes, error) {
|
||||
items, total, err := executionlog.List(ctx, &req.AppExecutionLogListParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ExecutionLogListRes{Items: items, Total: total}, nil
|
||||
}
|
||||
func (c *ExecutionLogController) Summary(ctx context.Context, req *v1.ExecutionLogSummaryReq) (*v1.ExecutionLogSummaryRes, error) {
|
||||
item, err := executionlog.Summary(ctx, req.BatchNo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ExecutionLogSummaryRes{AppExecutionLogItem: item}, nil
|
||||
}
|
||||
func (c *ExecutionLogController) Details(ctx context.Context, req *v1.ExecutionLogDetailsReq) (*v1.ExecutionLogDetailsRes, error) {
|
||||
items, total, err := executionlog.Details(ctx, &req.AppExecutionLogDetailParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ExecutionLogDetailsRes{Items: items, Total: total}, nil
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package gen
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <li@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package gen
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package gen
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <li@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package gen
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package gen
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <li@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package system
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/service"
|
||||
)
|
||||
|
||||
|
||||
func (c *ControllerV1) SysDictTypeList(ctx context.Context, req *v1.SysDictTypeListReq) (res *v1.SysDictTypeListRes, err error) {
|
||||
items, total, err := service.SysDictType().List(ctx, &req.SysDictTypeListParam)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user