|
@@ -3,18 +3,9 @@ package com.zhongzheng.controller.user;
|
|
|
import java.util.List;
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
-import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
-import com.zhongzheng.modules.user.bo.SchoolAddBo;
|
|
|
-import com.zhongzheng.modules.user.bo.SchoolEditBo;
|
|
|
-import com.zhongzheng.modules.user.bo.SchoolQueryBo;
|
|
|
-import com.zhongzheng.modules.user.domain.School;
|
|
|
-import com.zhongzheng.modules.user.service.ISchoolService;
|
|
|
-import com.zhongzheng.modules.user.vo.SchoolVo;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
@@ -27,7 +18,11 @@ import com.zhongzheng.common.annotation.Log;
|
|
|
import com.zhongzheng.common.core.controller.BaseController;
|
|
|
import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
import com.zhongzheng.common.enums.BusinessType;
|
|
|
-
|
|
|
+import com.zhongzheng.modules.user.vo.SchoolVo;
|
|
|
+import com.zhongzheng.modules.user.bo.SchoolQueryBo;
|
|
|
+import com.zhongzheng.modules.user.bo.SchoolAddBo;
|
|
|
+import com.zhongzheng.modules.user.bo.SchoolEditBo;
|
|
|
+import com.zhongzheng.modules.user.service.ISchoolService;
|
|
|
import com.zhongzheng.common.utils.poi.ExcelUtil;
|
|
|
import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -35,14 +30,14 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
/**
|
|
|
* 高校Controller
|
|
|
- *
|
|
|
- * @author hjl
|
|
|
- * @date 2021-05-19
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2021-10-09
|
|
|
*/
|
|
|
@Api(value = "高校控制器", tags = {"高校管理"})
|
|
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
@RestController
|
|
|
-@RequestMapping("/user/school")
|
|
|
+@RequestMapping("/modules.user/school")
|
|
|
public class SchoolController extends BaseController {
|
|
|
|
|
|
private final ISchoolService iSchoolService;
|
|
@@ -51,32 +46,32 @@ public class SchoolController extends BaseController {
|
|
|
* 查询高校列表
|
|
|
*/
|
|
|
@ApiOperation("查询高校列表")
|
|
|
- @PreAuthorize("@ss.hasPermi('user:school:list')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('modules.user:school:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo<School> list(SchoolQueryBo bo) {
|
|
|
+ public TableDataInfo<SchoolVo> list(SchoolQueryBo bo) {
|
|
|
startPage();
|
|
|
- List<School> list = iSchoolService.selectList(bo);
|
|
|
+ List<SchoolVo> list = iSchoolService.queryList(bo);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出高校列表
|
|
|
*/
|
|
|
- /*@ApiOperation("导出高校列表")
|
|
|
- @PreAuthorize("@ss.hasPermi('system:school:export')")
|
|
|
+ @ApiOperation("导出高校列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('modules.user:school:export')")
|
|
|
@Log(title = "高校", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/export")
|
|
|
public AjaxResult<SchoolVo> export(SchoolQueryBo bo) {
|
|
|
List<SchoolVo> list = iSchoolService.queryList(bo);
|
|
|
ExcelUtil<SchoolVo> util = new ExcelUtil<SchoolVo>(SchoolVo.class);
|
|
|
return util.exportExcel(list, "高校");
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 获取高校详细信息
|
|
|
*/
|
|
|
@ApiOperation("获取高校详细信息")
|
|
|
- @PreAuthorize("@ss.hasPermi('user:school:query')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('modules.user:school:query')")
|
|
|
@GetMapping("/{id}")
|
|
|
public AjaxResult<SchoolVo> getInfo(@PathVariable("id" ) Long id) {
|
|
|
return AjaxResult.success(iSchoolService.queryById(id));
|
|
@@ -86,11 +81,10 @@ public class SchoolController extends BaseController {
|
|
|
* 新增高校
|
|
|
*/
|
|
|
@ApiOperation("新增高校")
|
|
|
- @ApiOperationSupport(ignoreParameters = {"updateTime","createTime"})
|
|
|
- @PreAuthorize("@ss.hasPermi('user:school:add')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('modules.user:school:add')")
|
|
|
@Log(title = "高校", businessType = BusinessType.INSERT)
|
|
|
@PostMapping()
|
|
|
- public AjaxResult<Void> add(@Validated @RequestBody SchoolAddBo bo) {
|
|
|
+ public AjaxResult<Void> add(@RequestBody SchoolAddBo bo) {
|
|
|
return toAjax(iSchoolService.insertByAddBo(bo) ? 1 : 0);
|
|
|
}
|
|
|
|
|
@@ -98,22 +92,21 @@ public class SchoolController extends BaseController {
|
|
|
* 修改高校
|
|
|
*/
|
|
|
@ApiOperation("修改高校")
|
|
|
- @ApiOperationSupport(ignoreParameters = {"updateTime","createTime"})
|
|
|
- @PreAuthorize("@ss.hasPermi('user:school:edit')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('modules.user:school:edit')")
|
|
|
@Log(title = "高校", businessType = BusinessType.UPDATE)
|
|
|
- @PostMapping("/edit")
|
|
|
- public AjaxResult<Void> edit(@Validated @RequestBody SchoolEditBo bo) {
|
|
|
+ @PutMapping()
|
|
|
+ public AjaxResult<Void> edit(@RequestBody SchoolEditBo bo) {
|
|
|
return toAjax(iSchoolService.updateByEditBo(bo) ? 1 : 0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除高校
|
|
|
*/
|
|
|
- /* @ApiOperation("删除高校")
|
|
|
- @PreAuthorize("@ss.hasPermi('system:school:remove')")
|
|
|
+ @ApiOperation("删除高校")
|
|
|
+ @PreAuthorize("@ss.hasPermi('modules.user:school:remove')")
|
|
|
@Log(title = "高校" , businessType = BusinessType.DELETE)
|
|
|
- @PostMapping("/delete")
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
public AjaxResult<Void> remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(iSchoolService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|