mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-04-23 20:55:19 +08:00
feat: release1.8.0
This commit is contained in:
@@ -272,7 +272,7 @@ func (r *resourceAuthCertAppImpl) GetAccountAuthCert(accountId uint64, authCertT
|
||||
})
|
||||
|
||||
var authCerts []*entity.ResourceAuthCert
|
||||
r.GetRepo().ListByWheres(collx.M{
|
||||
r.ListByWheres(collx.M{
|
||||
"name in ?": collx.ArrayDeduplicate(authCertNames),
|
||||
}, &authCerts)
|
||||
|
||||
@@ -314,7 +314,7 @@ func (r *resourceAuthCertAppImpl) FillAuthCert(resourceType int8, resources ...e
|
||||
return ac.GetCode()
|
||||
})
|
||||
var acs []*entity.ResourceAuthCert
|
||||
r.Repo.ListByWheres(collx.M{"resource_code in ?": resourceCodes, "resource_type = ?": resourceType}, &acs)
|
||||
r.ListByWheres(collx.M{"resource_code in ?": resourceCodes, "resource_type = ?": resourceType}, &acs)
|
||||
r.FillAuthCertByAcs(acs, resources...)
|
||||
}
|
||||
|
||||
|
||||
@@ -394,7 +394,7 @@ func (p *tagTreeAppImpl) DeleteTagByParam(ctx context.Context, param *DelResourc
|
||||
for _, resourceTag := range resourceTags {
|
||||
// 获取所有关联的子标签
|
||||
var childrenTag []*entity.TagTree
|
||||
p.Repo.ListByWheres(collx.M{
|
||||
p.ListByWheres(collx.M{
|
||||
"code_path LIKE ?": resourceTag.CodePath + "%",
|
||||
"type = ?": delTagType,
|
||||
}, &childrenTag)
|
||||
|
||||
@@ -81,6 +81,10 @@ type App[T model.ModelI] interface {
|
||||
// 根据条件查询数据映射至listModels
|
||||
ListByCond(cond any, listModels any, cols ...string) error
|
||||
|
||||
// 根据wheres条件进行过滤
|
||||
// @param wheres key -> "age > ?" value -> 10等
|
||||
ListByWheres(wheres collx.M, listModels any, cols ...string) error
|
||||
|
||||
// PageQuery 分页查询
|
||||
PageQuery(cond any, pageParam *model.PageParam, toModels any) (*model.PageResult[any], error)
|
||||
|
||||
@@ -210,6 +214,10 @@ func (ai *AppImpl[T, R]) ListByCond(cond any, listModels any, cols ...string) er
|
||||
return ai.GetRepo().ListByCond(cond, listModels, cols...)
|
||||
}
|
||||
|
||||
func (ai *AppImpl[T, R]) ListByWheres(wheres collx.M, listModels any, cols ...string) error {
|
||||
return ai.GetRepo().ListByWheres(wheres, listModels, cols...)
|
||||
}
|
||||
|
||||
// PageQuery 分页查询
|
||||
func (ai *AppImpl[T, R]) PageQuery(cond any, pageParam *model.PageParam, toModels any) (*model.PageResult[any], error) {
|
||||
return ai.GetRepo().PageQuery(cond, pageParam, toModels)
|
||||
|
||||
@@ -4,7 +4,7 @@ import "fmt"
|
||||
|
||||
const (
|
||||
AppName = "mayfly-go"
|
||||
Version = "v1.7.5"
|
||||
Version = "v1.8.0"
|
||||
)
|
||||
|
||||
func GetAppInfo() string {
|
||||
|
||||
BIN
server/resources/data/mayfly-go.sqlite
Normal file → Executable file
BIN
server/resources/data/mayfly-go.sqlite
Normal file → Executable file
Binary file not shown.
@@ -885,7 +885,8 @@ CREATE TABLE `t_tag_tree` (
|
||||
`is_deleted` tinyint(8) NOT NULL DEFAULT 0,
|
||||
`delete_time` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_code_path` (`code_path`(100)) USING BTREE
|
||||
KEY `idx_code_path` (`code_path`(200)) USING BTREE,
|
||||
KEY `idx_code` (`code`(32)) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='标签树';
|
||||
|
||||
-- ----------------------------
|
||||
|
||||
Reference in New Issue
Block a user