新增设备类型选项接口
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled

This commit is contained in:
2026-09-22 12:35:26 +08:00
parent 22c3e7cc1a
commit 4330b8a40c
28 changed files with 671 additions and 8 deletions

View File

@@ -35,6 +35,16 @@ func (h *DeviceHandler) List(c *fiber.Ctx) error {
return response.SuccessWithPagination(c, result.List, result.Total, result.Page, result.PageSize)
}
// ListDeviceTypes 查询设备类型选项。
// GET /api/admin/devices/types
func (h *DeviceHandler) ListDeviceTypes(c *fiber.Ctx) error {
result, err := h.service.ListDeviceTypes(c.UserContext())
if err != nil {
return err
}
return response.Success(c, result)
}
// BatchUpdateRealnamePolicy 批量更新设备实名认证策略。
// POST /api/admin/devices/batch-update-realname-policy
func (h *DeviceHandler) BatchUpdateRealnamePolicy(c *fiber.Ctx) error {

View File

@@ -9,6 +9,7 @@ import (
employeecollectionapp "github.com/break/junhong_cmp_fiber/internal/application/employeecollection"
"github.com/break/junhong_cmp_fiber/internal/model/dto"
employeecollectionquery "github.com/break/junhong_cmp_fiber/internal/query/employeecollection"
"github.com/break/junhong_cmp_fiber/pkg/constants"
"github.com/break/junhong_cmp_fiber/pkg/errors"
"github.com/break/junhong_cmp_fiber/pkg/response"
)
@@ -268,6 +269,32 @@ func (h *EmployeeCollectionHandler) GetApplication(c *fiber.Ctx) error {
return response.Success(c, result)
}
// RecoverApplication 恢复核销申请的原审批提交事实。
// POST /api/admin/employee-collection-applications/:id/recover-approval
func (h *EmployeeCollectionHandler) RecoverApplication(c *fiber.Ctx) error {
id, err := pathID(c)
if err != nil {
return err
}
result, err := h.application.RecoverApproval(c.UserContext(), id)
if err != nil {
return err
}
return response.Success(c, &dto.EmployeeCollectionApplicationRecoveryResponse{
ApplicationID: result.ApplicationID, ApprovalInstanceID: result.ApprovalInstanceID,
Action: result.Action, Result: result.Result, SubmissionStatus: result.SubmissionStatus,
SubmissionStatusName: constants.GetWeComSubmissionStatusName(result.SubmissionStatus), Recoverable: result.Recoverable,
LastRecoveryAt: formatRecoveryTime(result.LastRecoveryAt),
})
}
func formatRecoveryTime(value *time.Time) string {
if value == nil {
return ""
}
return value.UTC().Format(time.RFC3339)
}
// bindApplicationRequest 绑定并转换创建或重提核销申请请求。
// 付款时间按带时区的 RFC3339 解析;其余边界与业务校验由应用用例统一判断。
func bindApplicationRequest(c *fiber.Ctx) (employeecollectionapp.SubmitApplicationCommand, error) {