chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/response"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) DeptExport(ctx context.Context, req *v1.DeptExportReq) (*v1.DeptExportRes, error) {
|
||||
return &v1.DeptExportRes{}, service.AgentDept().DeptExport(ctx, &req.AgentDeptListParam)
|
||||
}
|
||||
|
||||
func (c *ControllerV1) DeptList(ctx context.Context, req *v1.DeptListReq) (res *v1.DeptListRes, err error) {
|
||||
data, total, err := service.AgentDept().DeptList(ctx, &req.AgentDeptListParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.DeptListRes{PageResult: response.PageResult{Page: req.Page, PageSize: req.PageSize, Total: total}, Data: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) DeptView(ctx context.Context, req *v1.DeptViewReq) (res *v1.DeptViewRes, err error) {
|
||||
data, err := service.AgentDept().DeptView(ctx, req.DeptId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.DeptViewRes{AgentEnterpriseCustomerModel: *data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) DeptSave(ctx context.Context, req *v1.DeptSaveReq) (res *v1.DeptSaveRes, err error) {
|
||||
deptId, err := service.AgentDept().DeptSave(ctx, &req.AgentDeptSaveParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.DeptSaveRes{DeptId: deptId}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) DeptDelete(ctx context.Context, req *v1.DeptDeleteReq) (res *v1.DeptDeleteRes, err error) {
|
||||
err = service.AgentDept().DeptDelete(ctx, req.DeptId)
|
||||
return &v1.DeptDeleteRes{}, err
|
||||
}
|
||||
|
||||
func (c *ControllerV1) DeptResetPassword(ctx context.Context, req *v1.DeptResetPasswordReq) (res *v1.DeptResetPasswordRes, err error) {
|
||||
err = service.AgentDept().DeptResetPassword(ctx, req.DeptId, req.Password)
|
||||
return &v1.DeptResetPasswordRes{}, err
|
||||
}
|
||||
|
||||
func (c *ControllerV1) GetDeptApiInfo(ctx context.Context, req *v1.GetDeptApiInfoReq) (res *v1.GetDeptApiInfoRes, err error) {
|
||||
data, err := service.AgentDept().GetDeptApiInfo(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.GetDeptApiInfoRes{AgentDeptApiModel: *data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) Scope(ctx context.Context, req *v1.ScopeReq) (res *v1.ScopeRes, err error) {
|
||||
deptIds, err := service.AgentScope().ScopeDeptIds(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ScopeRes{DeptIds: deptIds}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) SubCompany(ctx context.Context, req *v1.SubCompanyReq) (res *v1.SubCompanyRes, err error) {
|
||||
data, err := service.AgentDept().SubCompany(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.SubCompanyRes{Data: data}, nil
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) MenuTree(ctx context.Context, req *v1.MenuTreeReq) (res *v1.MenuTreeRes, err error) {
|
||||
tree, menuIds, err := service.AgentMenu().AllowedMenuTree(ctx, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.MenuTreeRes{Items: tree, MenuIds: menuIds}, nil
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package agent
|
||||
|
||||
import "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent"
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() agent.IAgentV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/response"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) RoleList(ctx context.Context, req *v1.RoleListReq) (res *v1.RoleListRes, err error) {
|
||||
data, total, err := service.AgentRole().RoleList(ctx, &req.AgentRoleListParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.RoleListRes{PageResult: response.PageResult{Total: total}, Data: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) RoleView(ctx context.Context, req *v1.RoleViewReq) (res *v1.RoleViewRes, err error) {
|
||||
data, err := service.AgentRole().RoleView(ctx, req.RoleId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.RoleViewRes{AgentRoleViewModel: *data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) RoleSave(ctx context.Context, req *v1.RoleSaveReq) (res *v1.RoleSaveRes, err error) {
|
||||
roleId, err := service.AgentRole().RoleSave(ctx, &req.AgentRoleSaveParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.RoleSaveRes{RoleId: roleId}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) RoleDelete(ctx context.Context, req *v1.RoleDeleteReq) (res *v1.RoleDeleteRes, err error) {
|
||||
roleIds := req.RoleIds
|
||||
if req.RoleId != 0 {
|
||||
roleIds = append(roleIds, req.RoleId)
|
||||
}
|
||||
err = service.AgentRole().RoleDelete(ctx, roleIds)
|
||||
return &v1.RoleDeleteRes{}, err
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/response"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) UserExport(ctx context.Context, req *v1.UserExportReq) (*v1.UserExportRes, error) {
|
||||
return &v1.UserExportRes{}, service.AgentUser().UserExport(ctx, &req.AgentUserListParam)
|
||||
}
|
||||
|
||||
func (c *ControllerV1) UserList(ctx context.Context, req *v1.UserListReq) (res *v1.UserListRes, err error) {
|
||||
data, total, err := service.AgentUser().UserList(ctx, &req.AgentUserListParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.UserListRes{PageResult: response.PageResult{Page: req.Page, PageSize: req.PageSize, Total: total}, Data: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) UserView(ctx context.Context, req *v1.UserViewReq) (res *v1.UserViewRes, err error) {
|
||||
data, err := service.AgentUser().UserView(ctx, req.UserId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.UserViewRes{AgentUserViewModel: *data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) UserAdd(ctx context.Context, req *v1.UserAddReq) (res *v1.UserAddRes, err error) {
|
||||
data, err := service.AgentUser().UserSave(ctx, &req.SysUserAddModel)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.UserAddRes{Data: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) UserUpdate(ctx context.Context, req *v1.UserUpdateReq) (res *v1.UserUpdateRes, err error) {
|
||||
err = service.AgentUser().UserUpdate(ctx, &req.SysUserUpdateModel)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data, err := service.AgentUser().UserView(ctx, req.UserId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.UserUpdateRes{Data: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) UserDelete(ctx context.Context, req *v1.UserDeleteReq) (res *v1.UserDeleteRes, err error) {
|
||||
userIds := req.UserIds
|
||||
if req.UserId != 0 {
|
||||
userIds = append(userIds, req.UserId)
|
||||
}
|
||||
err = service.AgentUser().UserDelete(ctx, userIds)
|
||||
return &v1.UserDeleteRes{}, err
|
||||
}
|
||||
|
||||
func (c *ControllerV1) UserResetPassword(ctx context.Context, req *v1.UserResetPasswordReq) (res *v1.UserResetPasswordRes, err error) {
|
||||
err = service.AgentUser().UserResetPassword(ctx, req.UserId, req.Password)
|
||||
return &v1.UserResetPasswordRes{}, err
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
// List 查看企业客户单位信息列表
|
||||
func (c *ControllerV1) TAgentEnterpriseList(ctx context.Context, req *v1.TAgentEnterpriseListReq) (res *v1.TAgentEnterpriseListRes, err error) {
|
||||
list, totalCount, err := service.AgentEnterprise().List(ctx, &req.TAgentEnterpriseListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*model.TAgentEnterpriseListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.TAgentEnterpriseListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出企业客户单位信息列表
|
||||
func (c *ControllerV1) TAgentEnterpriseExport(ctx context.Context, req *v1.TAgentEnterpriseExportReq) (res *v1.TAgentEnterpriseExportRes, err error) {
|
||||
err = service.AgentEnterprise().Export(ctx, &req.TAgentEnterpriseListParam)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新企业客户单位信息
|
||||
func (c *ControllerV1) TAgentEnterpriseEdit(ctx context.Context, req *v1.TAgentEnterpriseEditReq) (res *v1.TAgentEnterpriseEditRes, err error) {
|
||||
err = service.AgentEnterprise().Edit(ctx, &req.TAgentEnterpriseEditParam)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定企业客户单位信息信息
|
||||
func (c *ControllerV1) TAgentEnterpriseView(ctx context.Context, req *v1.TAgentEnterpriseViewReq) (res *v1.TAgentEnterpriseViewRes, err error) {
|
||||
data, err := service.AgentEnterprise().View(ctx, &req.TAgentEnterpriseViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(v1.TAgentEnterpriseViewRes)
|
||||
res.TAgentEnterpriseViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除企业客户单位信息
|
||||
func (c *ControllerV1) TAgentEnterpriseDelete(ctx context.Context, req *v1.TAgentEnterpriseDeleteReq) (res *v1.TAgentEnterpriseDeleteRes, err error) {
|
||||
err = service.AgentEnterprise().Delete(ctx, &req.TAgentEnterpriseDeleteParam)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
// List 查看API集成列表
|
||||
func (c *ControllerV1) TApiList(ctx context.Context, req *v1.TApiListReq) (res *v1.TApiListRes, err error) {
|
||||
list, totalCount, err := service.AgentTApi().List(ctx, &req.TApiListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*model.TApiListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.TApiListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出API集成列表
|
||||
func (c *ControllerV1) TApiExport(ctx context.Context, req *v1.TApiExportReq) (res *v1.TApiExportRes, err error) {
|
||||
err = service.AgentTApi().Export(ctx, &req.TApiListParam)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新API集成
|
||||
func (c *ControllerV1) TApiEdit(ctx context.Context, req *v1.TApiEditReq) (res *v1.TApiEditRes, err error) {
|
||||
err = service.AgentTApi().Edit(ctx, &req.TApiEditParam)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定API集成信息
|
||||
func (c *ControllerV1) TApiView(ctx context.Context, req *v1.TApiViewReq) (res *v1.TApiViewRes, err error) {
|
||||
data, err := service.AgentTApi().View(ctx, &req.TApiViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(v1.TApiViewRes)
|
||||
res.TApiViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除API集成
|
||||
func (c *ControllerV1) TApiDelete(ctx context.Context, req *v1.TApiDeleteReq) (res *v1.TApiDeleteRes, err error) {
|
||||
err = service.AgentTApi().Delete(ctx, &req.TApiDeleteParam)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
// TApiGroupList 查询开放接口权限组列表。
|
||||
func (c *ControllerV1) TApiGroupList(ctx context.Context, req *v1.TApiGroupListReq) (res *v1.TApiGroupListRes, err error) {
|
||||
list, totalCount, err := service.AgentTApiGroup().List(ctx, &req.TApiGroupListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*model.TApiGroupListModel{}
|
||||
}
|
||||
res = new(v1.TApiGroupListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
// TApiGroupExport 导出开放接口权限组列表。
|
||||
func (c *ControllerV1) TApiGroupExport(ctx context.Context, req *v1.TApiGroupExportReq) (res *v1.TApiGroupExportRes, err error) {
|
||||
err = service.AgentTApiGroup().Export(ctx, &req.TApiGroupListParam)
|
||||
return
|
||||
}
|
||||
|
||||
// TApiGroupEdit 新增或修改开放接口权限组,并维护权限组绑定的接口资源。
|
||||
func (c *ControllerV1) TApiGroupEdit(ctx context.Context, req *v1.TApiGroupEditReq) (res *v1.TApiGroupEditRes, err error) {
|
||||
err = service.AgentTApiGroup().Edit(ctx, &req.TApiGroupEditParam)
|
||||
return
|
||||
}
|
||||
|
||||
// TApiGroupView 查询开放接口权限组详情。
|
||||
func (c *ControllerV1) TApiGroupView(ctx context.Context, req *v1.TApiGroupViewReq) (res *v1.TApiGroupViewRes, err error) {
|
||||
data, err := service.AgentTApiGroup().View(ctx, &req.TApiGroupViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = new(v1.TApiGroupViewRes)
|
||||
res.TApiGroupViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// TApiGroupDelete 删除开放接口权限组,并清理对应资源关联。
|
||||
func (c *ControllerV1) TApiGroupDelete(ctx context.Context, req *v1.TApiGroupDeleteReq) (res *v1.TApiGroupDeleteRes, err error) {
|
||||
err = service.AgentTApiGroup().Delete(ctx, &req.TApiGroupDeleteParam)
|
||||
return
|
||||
}
|
||||
|
||||
// TApiGroupStatus 更新开放接口权限组启停状态。
|
||||
func (c *ControllerV1) TApiGroupStatus(ctx context.Context, req *v1.TApiGroupStatusReq) (res *v1.TApiGroupStatusRes, err error) {
|
||||
err = service.AgentTApiGroup().Status(ctx, &req.TApiGroupStatusParam)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// TApiResourceList 查询开放接口资源列表。
|
||||
func (c *ControllerV1) TApiResourceList(ctx context.Context, req *v1.TApiResourceListReq) (res *v1.TApiResourceListRes, err error) {
|
||||
list, totalCount, err := service.AgentTApiResource().List(ctx, &req.TApiResourceListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*model.TApiResourceListModel{}
|
||||
}
|
||||
res = new(v1.TApiResourceListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
// TApiResourceExport 导出开放接口资源列表。
|
||||
func (c *ControllerV1) TApiResourceExport(ctx context.Context, req *v1.TApiResourceExportReq) (res *v1.TApiResourceExportRes, err error) {
|
||||
err = service.AgentTApiResource().Export(ctx, &req.TApiResourceListParam)
|
||||
return
|
||||
}
|
||||
|
||||
// TApiResourceEdit 新增或修改开放接口资源。
|
||||
func (c *ControllerV1) TApiResourceEdit(ctx context.Context, req *v1.TApiResourceEditReq) (res *v1.TApiResourceEditRes, err error) {
|
||||
param := req.TApiResourceEditParam
|
||||
g.Log().Info(ctx, "TApiResourceEdit", param)
|
||||
if r := g.RequestFromCtx(ctx); r != nil {
|
||||
if err = r.Parse(¶m); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
err = service.AgentTApiResource().Edit(ctx, ¶m)
|
||||
return
|
||||
}
|
||||
|
||||
// TApiResourceView 查询开放接口资源详情。
|
||||
func (c *ControllerV1) TApiResourceView(ctx context.Context, req *v1.TApiResourceViewReq) (res *v1.TApiResourceViewRes, err error) {
|
||||
data, err := service.AgentTApiResource().View(ctx, &req.TApiResourceViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = new(v1.TApiResourceViewRes)
|
||||
res.TApiResourceViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// TApiResourceDelete 删除开放接口资源,并清理权限组资源关联。
|
||||
func (c *ControllerV1) TApiResourceDelete(ctx context.Context, req *v1.TApiResourceDeleteReq) (res *v1.TApiResourceDeleteRes, err error) {
|
||||
err = service.AgentTApiResource().Delete(ctx, &req.TApiResourceDeleteParam)
|
||||
return
|
||||
}
|
||||
|
||||
// TApiResourceStatus 更新开放接口资源启停状态。
|
||||
func (c *ControllerV1) TApiResourceStatus(ctx context.Context, req *v1.TApiResourceStatusReq) (res *v1.TApiResourceStatusRes, err error) {
|
||||
err = service.AgentTApiResource().Status(ctx, &req.TApiResourceStatusParam)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/agent/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
// List 查看客户提现账户表列表
|
||||
func (c *ControllerV1) TCustWithdrawAccountList(ctx context.Context, req *v1.TCustWithdrawAccountListReq) (res *v1.TCustWithdrawAccountListRes, err error) {
|
||||
list, totalCount, err := service.AgentTCustWithdrawAccount().List(ctx, &req.TCustWithdrawAccountListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*model.TCustWithdrawAccountListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.TCustWithdrawAccountListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出客户提现账户表列表
|
||||
func (c *ControllerV1) TCustWithdrawAccountExport(ctx context.Context, req *v1.TCustWithdrawAccountExportReq) (res *v1.TCustWithdrawAccountExportRes, err error) {
|
||||
err = service.AgentTCustWithdrawAccount().Export(ctx, &req.TCustWithdrawAccountListParam)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新客户提现账户表
|
||||
func (c *ControllerV1) TCustWithdrawAccountEdit(ctx context.Context, req *v1.TCustWithdrawAccountEditReq) (res *v1.TCustWithdrawAccountEditRes, err error) {
|
||||
err = service.AgentTCustWithdrawAccount().Edit(ctx, &req.TCustWithdrawAccountEditParam)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定客户提现账户表信息
|
||||
func (c *ControllerV1) TCustWithdrawAccountView(ctx context.Context, req *v1.TCustWithdrawAccountViewReq) (res *v1.TCustWithdrawAccountViewRes, err error) {
|
||||
data, err := service.AgentTCustWithdrawAccount().View(ctx, &req.TCustWithdrawAccountViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(v1.TCustWithdrawAccountViewRes)
|
||||
res.TCustWithdrawAccountViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除客户提现账户表
|
||||
func (c *ControllerV1) TCustWithdrawAccountDelete(ctx context.Context, req *v1.TCustWithdrawAccountDeleteReq) (res *v1.TCustWithdrawAccountDeleteRes, err error) {
|
||||
err = service.AgentTCustWithdrawAccount().Delete(ctx, &req.TCustWithdrawAccountDeleteParam)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新客户提现账户表状态
|
||||
func (c *ControllerV1) TCustWithdrawAccountStatus(ctx context.Context, req *v1.TCustWithdrawAccountStatusReq) (res *v1.TCustWithdrawAccountStatusRes, err error) {
|
||||
err = service.AgentTCustWithdrawAccount().Status(ctx, &req.TCustWithdrawAccountStatusParam)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user