🔀 Merging branches. 修改代码生成路径、Controller 添加权限控制

This commit is contained in:
冷冷 2019-02-14 19:45:39 +08:00
commit ecc0aa7504
3 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -68,6 +68,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 +80,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 +92,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}));
}

View File

@ -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}',