消息配置功能调整
This commit is contained in:
@@ -4,9 +4,9 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.cssystem.api.fallback.AppInfoSetFeignClientFallbackFactory;
|
import com.njcn.cssystem.api.fallback.AppInfoSetFeignClientFallbackFactory;
|
||||||
import com.njcn.cssystem.pojo.po.AppInfoSet;
|
import com.njcn.cssystem.pojo.po.AppInfoSet;
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xy
|
* @author xy
|
||||||
@@ -15,8 +15,10 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
|
|
||||||
public interface AppInfoSetFeignClient {
|
public interface AppInfoSetFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
HttpResult<String> add(@RequestBody AppInfoSet appInfoSet);
|
||||||
|
|
||||||
@PostMapping("/queryByUserId")
|
@PostMapping("/queryByUserId")
|
||||||
@ApiOperation("查看用户消息推送配置")
|
|
||||||
HttpResult<AppInfoSet> queryByUserId();
|
HttpResult<AppInfoSet> queryByUserId();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ public class AppInfoSetFeignClientFallbackFactory implements FallbackFactory<App
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new AppInfoSetFeignClient() {
|
return new AppInfoSetFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> add(AppInfoSet appInfoSet) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","新增用户消息推送配置",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<AppInfoSet> queryByUserId() {
|
public HttpResult<AppInfoSet> queryByUserId() {
|
||||||
log.error("{}异常,降级处理,异常为:{}","查看用户消息推送配置",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查看用户消息推送配置",cause.toString());
|
||||||
|
|||||||
@@ -35,6 +35,16 @@ public class AppInfoSetController extends BaseController {
|
|||||||
|
|
||||||
private final IAppInfoSetService appInfoSetService;
|
private final IAppInfoSetService appInfoSetService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增用户消息推送配置")
|
||||||
|
@ApiImplicitParam(name = "appInfoSet", value = "参数实体", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody AppInfoSet appInfoSet){
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
appInfoSetService.save(appInfoSet);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryByUserId")
|
@PostMapping("/queryByUserId")
|
||||||
@ApiOperation("查看用户消息推送配置")
|
@ApiOperation("查看用户消息推送配置")
|
||||||
|
|||||||
Reference in New Issue
Block a user