Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
8f51d4ca
提交
8f51d4ca
编写于
7月 31, 2022
作者:
ibiz4j
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交
上级
13eacd10
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
143 行增加
和
0 行删除
+143
-0
{{entities@ServiceAPI}}FeignClient.java.hbs
...ules}}/client/{{entities@ServiceAPI}}FeignClient.java.hbs
+143
-0
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/client/{{entities@ServiceAPI}}FeignClient.java.hbs
0 → 100644
浏览文件 @
8f51d4ca
package
{{
packageName
}}
.core.
{{
entity
.
module
}}
.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.util.security.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.Assert;
import org.springframework.beans.factory.annotation.Value;
import cn.ibizlab.util.errors.BadRequestAlertException;
{{#
system
.
enableGlobalTransaction
}}
import io.seata.spring.annotation.GlobalTransactional;
{{/
system
.
enableGlobalTransaction
}}
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.domain.
{{
entity
.
codeName
}}
;
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.filter.
{{
entity
.
codeName
}}
SearchContext;
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.service.
{{
entity
.
codeName
}}
Service;
import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
/**
* 实体[
{{
entity
.
logicName
}}
] 服务对象接口实现
*/
@Slf4j
@Service("
{{
entity
.
codeName
}}
Service")
public class
{{
entity
.
codeName
}}
FeignClient implements
{{
entity
.
codeName
}}
Service {
default
{{
entity
.
codeName
}}
get(
{{
entity
.
codeName
}}
et){
return get(et.get
{{
pascalCase
entity
.
keyField
.
codeName
}}
());
}
@RequestMapping(method = RequestMethod.GET, value = "/
{{
pluralize
entity
.
codeName
}}
/{key}")
{{
entity
.
codeName
}}
get(
{{
entity
.
keyField
.
type
.
java
}}
key) {
{{
entity
.
codeName
}}
et = new
{{
entity
.
codeName
}}
();
et.set
{{
pascalCase
entity
.
keyField
.
codeName
}}
(key);
return get(et);
}
default List
<
{{
entity
.
codeName
}}
>
getByIds(Collection
<
{{
entity
.
keyField
.
type
.
java
}}
>
ids) {
List
<
{{
entity
.
codeName
}}
>
entities =new ArrayList();
ids.forEach(key -> {
{{
entity
.
codeName
}}
et = new
{{
entity
.
codeName
}}
();
et.set
{{
pascalCase
entity
.
keyField
.
codeName
}}
(key);
entities.add(et);
});
return getByEntities(entities);
}
List
<
{{
entity
.
codeName
}}
>
getByEntities(List
<
{{
entity
.
codeName
}}
>
entities);
{{
entity
.
codeName
}}
getDraft(
{{
entity
.
codeName
}}
et);
Integer checkKey(
{{
entity
.
codeName
}}
et);
boolean create(
{{
entity
.
codeName
}}
et);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean createBatch(List
<
{{
entity
.
codeName
}}
>
list);
boolean update(
{{
entity
.
codeName
}}
et);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean updateBatch(List
<
{{
entity
.
codeName
}}
>
list);
boolean save(
{{
entity
.
codeName
}}
et);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean saveBatch(List
<
{{
entity
.
codeName
}}
>
list);
default boolean remove(
{{
entity
.
keyField
.
type
.
java
}}
key) {
{{
entity
.
codeName
}}
et = new
{{
entity
.
codeName
}}
();
et.set
{{
pascalCase
entity
.
keyField
.
codeName
}}
(key);
return remove(et);
}
default boolean remove(List
<
{{
entity
.
keyField
.
type
.
java
}}
>
key) {
return removeBatch(key);
}
boolean remove(
{{
entity
.
codeName
}}
et);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean removeBatch(Collection
<
{{
entity
.
keyField
.
type
.
java
}}
>
ids);
{{#
each
entity
.
extActions
}}
default
{{
outParam
}}
{{
camelCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) {
{{#if
voidReturn
}}
return
{{
inParamName
}}
;
{{else}}
return null;
{{/if}}
}
{{/
each
}}
{{#
entity
.
dataSets
}}
Page
<
{{
entity
.
codeName
}}
>
search
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext context);
List
<
{{
entity
.
codeName
}}
>
list
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext context);
{{/
entity
.
dataSets
}}
{{#
entity
.
references
}}
List
<
{{
entity
.
codeName
}}
>
selectBy
{{
pascalCase
fkField
.
codeName
}}
(
{{
fkField
.
type
.
java
}}
{{
camelCase
fkField
.
codeName
}}
);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean removeBy
{{
pascalCase
fkField
.
codeName
}}
(
{{
fkField
.
type
.
java
}}
{{
camelCase
fkField
.
codeName
}}
);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean resetBy
{{
pascalCase
fkField
.
codeName
}}
(
{{
fkField
.
type
.
java
}}
{{
camelCase
fkField
.
codeName
}}
);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean saveBy
{{
pascalCase
fkField
.
codeName
}}
(
{{
fkField
.
type
.
java
}}
{{
camelCase
fkField
.
codeName
}}
,List
<
{{
entity
.
codeName
}}
>
list);
{{/
entity
.
references
}}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录