消息配置功能调整

This commit is contained in:
2023-08-22 10:05:30 +08:00
parent 393f6973fa
commit c77ab6ee3e
3 changed files with 20 additions and 2 deletions

View File

@@ -4,9 +4,9 @@ import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.cssystem.api.fallback.AppInfoSetFeignClientFallbackFactory;
import com.njcn.cssystem.pojo.po.AppInfoSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @author xy
@@ -15,8 +15,10 @@ import org.springframework.web.bind.annotation.PostMapping;
public interface AppInfoSetFeignClient {
@PostMapping("/add")
HttpResult<String> add(@RequestBody AppInfoSet appInfoSet);
@PostMapping("/queryByUserId")
@ApiOperation("查看用户消息推送配置")
HttpResult<AppInfoSet> queryByUserId();
}

View File

@@ -31,6 +31,12 @@ public class AppInfoSetFeignClientFallbackFactory implements FallbackFactory<App
Enum<?> finalExceptionEnum = exceptionEnum;
return new AppInfoSetFeignClient() {
@Override
public HttpResult<String> add(AppInfoSet appInfoSet) {
log.error("{}异常,降级处理,异常为:{}","新增用户消息推送配置",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<AppInfoSet> queryByUserId() {
log.error("{}异常,降级处理,异常为:{}","查看用户消息推送配置",cause.toString());

View File

@@ -35,6 +35,16 @@ public class AppInfoSetController extends BaseController {
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)
@PostMapping("/queryByUserId")
@ApiOperation("查看用户消息推送配置")