|
@@ -1,36 +1,66 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
-import com.ym.mec.biz.dal.entity.ChargeType;
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.entity.SysSuggestion;
|
|
|
-import com.ym.mec.biz.service.ChargeTypeService;
|
|
|
+import com.ym.mec.biz.dal.enums.SuggestionType;
|
|
|
+import com.ym.mec.biz.dal.page.SysSuggestionQueryInfo;
|
|
|
import com.ym.mec.biz.service.SysSuggestionService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
-import com.ym.mec.common.page.QueryInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
+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.*;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
-@RequestMapping("sysSuggestion")
|
|
|
@Api(tags = "意见反馈")
|
|
|
@RestController
|
|
|
public class SysSuggestionController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private SysSuggestionService sysSuggestionService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@ApiOperation(value = "新增")
|
|
|
- @RequestMapping("/add")
|
|
|
+ @RequestMapping("sysSuggestion/add")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysSuggestion/add')")
|
|
|
public Object add(SysSuggestion sysSuggestion) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ 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 = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ sysSuggestion.setUserId(sysUser.getId().longValue());
|
|
|
+ sysSuggestion.setClientType("EDUCATION");
|
|
|
+ if(StringUtils.isEmpty(sysSuggestion.getMobileNo())){
|
|
|
+ sysSuggestion.setMobileNo(sysUser.getPhone());
|
|
|
+ }
|
|
|
sysSuggestionService.insert(sysSuggestion);
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除")
|
|
|
- @RequestMapping("/del")
|
|
|
+ @RequestMapping("sysSuggestion/del")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysSuggestion/del')")
|
|
|
public Object del(Long id) {
|
|
|
sysSuggestionService.delete(id);
|
|
@@ -38,9 +68,9 @@ public class SysSuggestionController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
- @RequestMapping("/queryPage")
|
|
|
+ @RequestMapping("sysSuggestion/queryPage")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysSuggestion/queryPage')")
|
|
|
- public Object queryPage(QueryInfo queryInfo) {
|
|
|
+ public Object queryPage(SysSuggestionQueryInfo queryInfo) {
|
|
|
return succeed(sysSuggestionService.queryPage(queryInfo));
|
|
|
}
|
|
|
|