|
@@ -1,65 +1,33 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
-import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.entity.SysSuggestion;
|
|
|
import com.ym.mec.biz.dal.page.SysSuggestionQueryInfo;
|
|
|
import com.ym.mec.biz.service.SysSuggestionService;
|
|
|
-import com.ym.mec.biz.service.SysUserService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@Api(tags = "意见反馈")
|
|
|
@RestController
|
|
|
-@RequestMapping("${app-config.url.web:}/")
|
|
|
+@RequestMapping("${app-config.url.web:}/sysSuggestion")
|
|
|
public class SysSuggestionController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private SysSuggestionService sysSuggestionService;
|
|
|
- @Autowired
|
|
|
- private SysUserService sysUserService;
|
|
|
-
|
|
|
- @ApiOperation(value = "新增")
|
|
|
- @RequestMapping("sysSuggestion/add")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('sysSuggestion/add')")
|
|
|
- public Object add(SysSuggestion sysSuggestion) {
|
|
|
- SysUser sysUser = sysUserService.getUser();
|
|
|
- sysSuggestion.setUserId(sysUser.getId().longValue());
|
|
|
- sysSuggestion.setClientType("TEACHER");
|
|
|
- if(StringUtils.isEmpty(sysSuggestion.getMobileNo())){
|
|
|
- sysSuggestion.setMobileNo(sysUser.getPhone());
|
|
|
- }
|
|
|
- sysSuggestionService.insert(sysSuggestion);
|
|
|
- return succeed();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "新增")
|
|
|
- @RequestMapping("suggestion/add")
|
|
|
- public Object suggestionAdd(SysSuggestion sysSuggestion) {
|
|
|
- SysUser sysUser = sysUserService.getUser();
|
|
|
- sysSuggestion.setUserId(sysUser.getId().longValue());
|
|
|
- sysSuggestion.setClientType("EDUCATION");
|
|
|
- if(StringUtils.isEmpty(sysSuggestion.getMobileNo())){
|
|
|
- sysSuggestion.setMobileNo(sysUser.getPhone());
|
|
|
- }
|
|
|
- sysSuggestionService.insert(sysSuggestion);
|
|
|
- return succeed();
|
|
|
- }
|
|
|
|
|
|
@ApiOperation(value = "获取详情")
|
|
|
- @GetMapping("sysSuggestion/detail")
|
|
|
+ @GetMapping("/detail")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysSuggestion/detail')")
|
|
|
public HttpResponseResult<SysSuggestion> detail(Long id) {
|
|
|
return succeed(sysSuggestionService.getDetail(id));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "处理")
|
|
|
- @PostMapping("sysSuggestion/dispose")
|
|
|
+ @PostMapping("/dispose")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysSuggestion/dispose')")
|
|
|
public HttpResponseResult<Object> dispose(@RequestBody SysSuggestion sysSuggestion) {
|
|
|
sysSuggestionService.dispose(sysSuggestion);
|
|
@@ -67,7 +35,7 @@ public class SysSuggestionController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除")
|
|
|
- @GetMapping("sysSuggestion/del")
|
|
|
+ @GetMapping("/del")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysSuggestion/del')")
|
|
|
public Object del(Long id) {
|
|
|
sysSuggestionService.delete(id);
|
|
@@ -75,7 +43,7 @@ public class SysSuggestionController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
- @PostMapping("sysSuggestion/queryPage")
|
|
|
+ @PostMapping("/queryPage")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysSuggestion/queryPage')")
|
|
|
public Object queryPage(@RequestBody SysSuggestionQueryInfo queryInfo) {
|
|
|
return succeed(sysSuggestionService.queryPage(queryInfo));
|