chore: 初始开源发布
iotlcm-app:小程序端 + 用户端服务。 - app/:uni-app 小程序前端(基于 unibest,MIT) - 微信 AppID → YOUR_WX_APPID,uni-app AppID → __UNI__YOURAPPID - 内网后端地址 → admin.iotlcm.example.com - 应用标题与 unibest 模板 README 重写(保留上游致谢与 MIT 声明) - server/:GoFrame 用户端服务(基于 XiuAdmin,Apache-2.0) - module xiuadmin → git.5iot.com/iotlcm-public/iotlcm-app(360 文件) - 支付回调地址 → app.iotlcm.example.com,商户名与应用名泛化 - 真实手机号 → 合法 11 位编造号(保留号段前 3 位 + 后 4 位) - 依赖号码尾部的断言同步更新 - 补 server/LICENSE(Apache-2.0) - 移除内部资产:CI 触发器 - 补根 README,LF 行尾 + .gitattributes 已知:TestSysDept_RefreshDeptAncestors 在源仓同一提交上同样失败,属既有缺陷。
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
// Package @{.templateGroup}
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) @{NowYear} LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version @{.xiuVersion}
|
||||
//
|
||||
package @{.templateGroup}
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "@{.importApi}"
|
||||
"xiuadmin/internal/model/input/form"
|
||||
"@{.importInput}"
|
||||
"@{.importService}"
|
||||
)
|
||||
|
||||
var (
|
||||
@{.varName} = c@{.varName}{}
|
||||
)
|
||||
|
||||
type c@{.varName} struct{}
|
||||
|
||||
// List 查看@{.tableComment}列表
|
||||
func (c *c@{.varName}) @{.varName}List(ctx context.Context, req *v1.@{.varName}ListReq) (res *v1.@{.varName}ListRes, err error) {
|
||||
list, totalCount, err := service.@{.servFunName}().List(ctx, &req.@{.varName}ListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*@{.templateGroup}in.@{.varName}ListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.@{.varName}ListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
@{ if eq .options.Step.HasExport true }
|
||||
// Export 导出@{.tableComment}列表
|
||||
func (c *c@{.varName}) @{.varName}Export(ctx context.Context, req *v1.@{.varName}ExportReq) (res *v1.@{.varName}ExportRes, err error) {
|
||||
err = service.@{.servFunName}().Export(ctx, &req.@{.varName}ListParam)
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
@{ if eq .options.Step.HasEdit true }
|
||||
// Edit 更新@{.tableComment}
|
||||
func (c *c@{.varName}) @{.varName}Edit(ctx context.Context, req *v1.@{.varName}EditReq) (res *v1.@{.varName}EditRes, err error) {
|
||||
err = service.@{.servFunName}().Edit(ctx, &req.@{.varName}EditParam)
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
@{ if and (eq .options.Step.HasEdit true) (eq .options.Step.HasMaxSort true) }
|
||||
// MaxSort 获取@{.tableComment}最大排序
|
||||
func (c *c@{.varName}) @{.varName}MaxSort(ctx context.Context, req *v1.@{.varName}MaxSortReq) (res *v1.@{.varName}MaxSortRes, err error) {
|
||||
data, err := service.@{.servFunName}().MaxSort(ctx, &req.@{.varName}MaxSortParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(@{.varName | ToLower}.MaxSortRes)
|
||||
res.@{.varName}MaxSortModel = data
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
@{ if or (eq .options.Step.HasView true) (eq .options.Step.HasEdit true) }
|
||||
// View 获取指定@{.tableComment}信息
|
||||
func (c *c@{.varName}) @{.varName}View(ctx context.Context, req *v1.@{.varName}ViewReq) (res *v1.@{.varName}ViewRes, err error) {
|
||||
data, err := service.@{.servFunName}().View(ctx, &req.@{.varName}ViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(v1.@{.varName}ViewRes)
|
||||
res.@{.varName}ViewModel = data
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
@{ if eq .options.Step.HasDel true }
|
||||
// Delete 删除@{.tableComment}
|
||||
func (c *c@{.varName}) @{.varName}Delete(ctx context.Context, req *v1.@{.varName}DeleteReq) (res *v1.@{.varName}DeleteRes, err error) {
|
||||
err = service.@{.servFunName}().Delete(ctx, &req.@{.varName}DeleteParam)
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
@{ if eq .options.Step.HasStatus true }
|
||||
// Status 更新@{.tableComment}状态
|
||||
func (c *c@{.varName}) @{.varName}Status(ctx context.Context, req *v1.@{.varName}StatusReq) (res *v1.@{.varName}StatusRes, err error) {
|
||||
err = service.@{.servFunName}().Status(ctx, &req.@{.varName}StatusParam)
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
@{ if eq .options.Step.HasSwitch true }
|
||||
// Switch 更新@{.tableComment}开关状态
|
||||
func (c *c@{.varName}) @{.varName}Switch(ctx context.Context, req *v1.@{.varName}SwitchReq) (res *v1.@{.varName}SwitchRes, err error) {
|
||||
err = service.@{.servFunName}().Switch(ctx, &req.@{.varName}SwitchParam)
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
@{ if eq .options.Step.IsTreeTable true }
|
||||
// TreeOption 获取@{.tableComment}关系树选项
|
||||
func (c *c@{.varName}) @{.varName}TreeOption(ctx context.Context, req *v1.@{.varName}TreeOptionReq) (res *v1.@{.varName}TreeOptionRes, err error) {
|
||||
data, err := service.@{.servFunName}().TreeOption(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(data) > 0 {
|
||||
res = (*v1.@{.varName}TreeOptionRes)(&data)
|
||||
} else {
|
||||
temp := make(v1.@{.varName}TreeOptionRes, 0)
|
||||
res = &temp
|
||||
}
|
||||
return
|
||||
}
|
||||
@{end}
|
||||
Reference in New Issue
Block a user