Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pig_冷冷
Pig
提交
b624ae8e
Pig
项目概览
pig_冷冷
/
Pig
上一次同步 11 个月
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Pig
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b624ae8e
编写于
2月 14, 2019
作者:
S
saintloong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改代码生成路径、增加swagger api注解、Controller 添加权限控制
上级
d88e91a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
4 deletion
+8
-4
pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/util/GenUtils.java
...rc/main/java/com/pig4cloud/pig/codegen/util/GenUtils.java
+2
-2
pig-visual/pig-codegen/src/main/resources/template/Controller.java.vm
...ig-codegen/src/main/resources/template/Controller.java.vm
+4
-0
pig-visual/pig-codegen/src/main/resources/template/index.vue.vm
...sual/pig-codegen/src/main/resources/template/index.vue.vm
+2
-2
未找到文件。
pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/util/GenUtils.java
浏览文件 @
b624ae8e
...
...
@@ -278,12 +278,12 @@ public class GenUtils {
}
if
(
template
.
contains
(
API_JS_VM
))
{
return
CommonConstants
.
FRONT_END_PROJECT
+
File
.
separator
+
"src"
+
File
.
separator
+
"api"
+
File
.
separator
+
className
.
toLowerCase
()
+
".js"
;
return
CommonConstants
.
FRONT_END_PROJECT
+
File
.
separator
+
"src"
+
File
.
separator
+
"api"
+
File
.
separator
+
moduleName
+
File
.
separator
+
className
.
toLowerCase
()
+
".js"
;
}
if
(
template
.
contains
(
CRUD_JS_VM
))
{
return
CommonConstants
.
FRONT_END_PROJECT
+
File
.
separator
+
"src"
+
File
.
separator
+
"const"
+
File
.
separator
+
"crud"
+
File
.
separator
+
className
.
toLowerCase
()
+
".js"
;
File
.
separator
+
"crud"
+
File
.
separator
+
moduleName
+
File
.
separator
+
className
.
toLowerCase
()
+
".js"
;
}
return
null
;
...
...
pig-visual/pig-codegen/src/main/resources/template/Controller.java.vm
浏览文件 @
b624ae8e
...
...
@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.*;
@RestController
@AllArgsConstructor
@RequestMapping("/
${
pathName
}
")
@Api(value = "
${
pathName
}
", description = "
${
comments
}
")
public class
${
className
}
Controller
{
private final
${
className
}
Service
${
classname
}
Service;
...
...
@@ -68,6 +69,7 @@ public class ${className}Controller {
*/
@SysLog("新增
${
comments
}
")
@PostMapping
@PreAuthorize("@pms.hasPermission('
${
moduleName
}
_
${
pathName
}
_add')")
public R save(@RequestBody
${
className
}
${
classname
}
)
{
return new R
<>
(
${
classname
}
Service.save(
${
classname
}
));
}
...
...
@@ -79,6 +81,7 @@ public class ${className}Controller {
*/
@SysLog("修改
${
comments
}
")
@PutMapping
@PreAuthorize("@pms.hasPermission('
${
moduleName
}
_
${
pathName
}
_edit')")
public R update(@RequestBody
${
className
}
${
classname
}
)
{
return new R
<>
(
${
classname
}
Service.updateById(
${
classname
}
));
}
...
...
@@ -90,6 +93,7 @@ public class ${className}Controller {
*/
@SysLog("删除
${
comments
}
")
@DeleteMapping("/
{
${
pk
.
lowerAttrName
}
}")
@PreAuthorize("@pms.hasPermission('
${
moduleName
}
_
${
pathName
}
_del')")
public R removeById(@PathVariable
${
pk
.
attrType
}
${
pk
.
lowerAttrName
}
)
{
return new R
<>
(
${
classname
}
Service.removeById(
${
pk
.
lowerAttrName
}
));
}
...
...
pig-visual/pig-codegen/src/main/resources/template/index.vue.vm
浏览文件 @
b624ae8e
...
...
@@ -40,8 +40,8 @@
</template>
<script>
import
{
fetchList
,
getObj
,
addObj
,
putObj
,
delObj
}
from
'
@/api/
${
pathName
}
'
import
{
tableOption
}
from
'
@/const/crud/
${
pathName
}
'
import
{
fetchList
,
getObj
,
addObj
,
putObj
,
delObj
}
from
'
@/api/
${
moduleName
}
/
${
pathName
}
'
import
{
tableOption
}
from
'
@/const/crud/
${
moduleName
}
/
${
pathName
}
'
import
{
mapGetters
}
from
'
vuex
'
export
default
{
name
:
'
${
pathName
}
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录