|
@@ -10,10 +10,14 @@ import java.io.UnsupportedEncodingException;
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+
|
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
|
+import org.jeecg.modules.system.app.dto.AppCategoryDTO;
|
|
import org.jeecg.modules.system.app.entity.AppCategory;
|
|
import org.jeecg.modules.system.app.entity.AppCategory;
|
|
import org.jeecg.modules.system.app.service.IAppCategoryService;
|
|
import org.jeecg.modules.system.app.service.IAppCategoryService;
|
|
|
|
|
|
@@ -22,6 +26,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
+import org.jeecg.modules.system.app.vo.AppCategoryVO;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
@@ -46,7 +51,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
*/
|
|
*/
|
|
@Tag(name="运动类型表")
|
|
@Tag(name="运动类型表")
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/org/jeecg/modules/app/appCategory")
|
|
|
|
|
|
+@RequestMapping("/app/appCategory")
|
|
@Slf4j
|
|
@Slf4j
|
|
public class AppCategoryController extends JeecgController<AppCategory, IAppCategoryService> {
|
|
public class AppCategoryController extends JeecgController<AppCategory, IAppCategoryService> {
|
|
@Autowired
|
|
@Autowired
|
|
@@ -55,56 +60,42 @@ public class AppCategoryController extends JeecgController<AppCategory, IAppCate
|
|
/**
|
|
/**
|
|
* 分页列表查询
|
|
* 分页列表查询
|
|
*
|
|
*
|
|
- * @param appCategory
|
|
|
|
- * @param pageNo
|
|
|
|
- * @param pageSize
|
|
|
|
- * @param req
|
|
|
|
|
|
+ * @param dto
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
//@AutoLog(value = "运动类型表-分页列表查询")
|
|
//@AutoLog(value = "运动类型表-分页列表查询")
|
|
@Operation(summary="运动类型表-分页列表查询")
|
|
@Operation(summary="运动类型表-分页列表查询")
|
|
@GetMapping(value = "/list")
|
|
@GetMapping(value = "/list")
|
|
- public Result<IPage<AppCategory>> queryPageList(AppCategory appCategory,
|
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
- HttpServletRequest req) {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- QueryWrapper<AppCategory> queryWrapper = QueryGenerator.initQueryWrapper(appCategory, req.getParameterMap());
|
|
|
|
- Page<AppCategory> page = new Page<AppCategory>(pageNo, pageSize);
|
|
|
|
- IPage<AppCategory> pageList = appCategoryService.page(page, queryWrapper);
|
|
|
|
- return Result.OK(pageList);
|
|
|
|
|
|
+ public Result<IPage<AppCategoryVO>> queryPageList(AppCategoryDTO dto) {
|
|
|
|
+ return Result.OK(appCategoryService.queryCategoryList(dto));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加
|
|
* 添加
|
|
*
|
|
*
|
|
- * @param appCategory
|
|
|
|
|
|
+ * @param appCategoryVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@AutoLog(value = "运动类型表-添加")
|
|
@AutoLog(value = "运动类型表-添加")
|
|
@Operation(summary="运动类型表-添加")
|
|
@Operation(summary="运动类型表-添加")
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_category:add")
|
|
|
|
|
|
+// @RequiresPermissions("org.jeecg.modules.app:nm_category:add")
|
|
@PostMapping(value = "/add")
|
|
@PostMapping(value = "/add")
|
|
- public Result<String> add(@RequestBody AppCategory appCategory) {
|
|
|
|
- appCategoryService.save(appCategory);
|
|
|
|
-
|
|
|
|
- return Result.OK("添加成功!");
|
|
|
|
|
|
+ public Result<String> add(@RequestBody AppCategoryVO appCategoryVO) {
|
|
|
|
+ return appCategoryService.saveCategory(appCategoryVO)?Result.OK("添加成功!") :Result.error("添加失败!");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 编辑
|
|
* 编辑
|
|
*
|
|
*
|
|
- * @param appCategory
|
|
|
|
|
|
+ * @param appCategoryDTO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@AutoLog(value = "运动类型表-编辑")
|
|
@AutoLog(value = "运动类型表-编辑")
|
|
@Operation(summary="运动类型表-编辑")
|
|
@Operation(summary="运动类型表-编辑")
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_category:edit")
|
|
|
|
|
|
+// @RequiresPermissions("org.jeecg.modules.app:nm_category:edit")
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
- public Result<String> edit(@RequestBody AppCategory appCategory) {
|
|
|
|
- appCategoryService.updateById(appCategory);
|
|
|
|
- return Result.OK("编辑成功!");
|
|
|
|
|
|
+ public Result<String> edit(@RequestBody AppCategoryDTO appCategoryDTO) {
|
|
|
|
+ return appCategoryService.editCategory(appCategoryDTO)?Result.OK("操作成功!") :Result.error("操作失败!");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -115,11 +106,10 @@ public class AppCategoryController extends JeecgController<AppCategory, IAppCate
|
|
*/
|
|
*/
|
|
@AutoLog(value = "运动类型表-通过id删除")
|
|
@AutoLog(value = "运动类型表-通过id删除")
|
|
@Operation(summary="运动类型表-通过id删除")
|
|
@Operation(summary="运动类型表-通过id删除")
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_category:delete")
|
|
|
|
|
|
+// @RequiresPermissions("org.jeecg.modules.app:nm_category:delete")
|
|
@DeleteMapping(value = "/delete")
|
|
@DeleteMapping(value = "/delete")
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
- appCategoryService.removeById(id);
|
|
|
|
- return Result.OK("删除成功!");
|
|
|
|
|
|
+ return appCategoryService.deleteCategory(id)?Result.OK("操作成功!"):Result.error("操作失败!");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -130,7 +120,7 @@ public class AppCategoryController extends JeecgController<AppCategory, IAppCate
|
|
*/
|
|
*/
|
|
@AutoLog(value = "运动类型表-批量删除")
|
|
@AutoLog(value = "运动类型表-批量删除")
|
|
@Operation(summary="运动类型表-批量删除")
|
|
@Operation(summary="运动类型表-批量删除")
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_category:deleteBatch")
|
|
|
|
|
|
+// @RequiresPermissions("org.jeecg.modules.app:nm_category:deleteBatch")
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
this.appCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
|
this.appCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|