Commit b12ade94 by Lem

删除渠道

parent be9b3067
...@@ -50,6 +50,9 @@ public class DownloadAddressDTO implements Serializable { ...@@ -50,6 +50,9 @@ public class DownloadAddressDTO implements Serializable {
@ApiModelProperty("更新内容描述") @ApiModelProperty("更新内容描述")
private String descr; private String descr;
@ApiModelProperty("渠道")
private String channel;
@ApiModelProperty("推广组名称") @ApiModelProperty("推广组名称")
private String channelName; private String channelName;
...@@ -59,4 +62,9 @@ public class DownloadAddressDTO implements Serializable { ...@@ -59,4 +62,9 @@ public class DownloadAddressDTO implements Serializable {
@ApiModelProperty("是否禁用") @ApiModelProperty("是否禁用")
private Integer deleted; private Integer deleted;
@ApiModelProperty("多渠道对")
private Map<Integer,String> channelMap;
} }
...@@ -5,6 +5,8 @@ import com.live.common.domain.ResponseData; ...@@ -5,6 +5,8 @@ import com.live.common.domain.ResponseData;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.DuplicateKeyException; import org.springframework.dao.DuplicateKeyException;
import org.springframework.http.converter.HttpMessageNotReadableException; import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingServletRequestParameterException; import org.springframework.web.bind.MissingServletRequestParameterException;
...@@ -12,6 +14,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler; ...@@ -12,6 +14,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.multipart.MaxUploadSizeExceededException;
import java.util.List;
@Slf4j @Slf4j
@RestControllerAdvice @RestControllerAdvice
public class GlobalExceptionHandler { public class GlobalExceptionHandler {
...@@ -45,9 +49,14 @@ public class GlobalExceptionHandler { ...@@ -45,9 +49,14 @@ public class GlobalExceptionHandler {
} }
@ExceptionHandler(MethodArgumentNotValidException.class) @ExceptionHandler(MethodArgumentNotValidException.class)
public ResponseData<?> diyValidationExceptionHandler(Exception e) { public ResponseData<?> methodArgumentNotValidException(MethodArgumentNotValidException ex) {
log.error(e.getMessage()); BindingResult result = ex.getBindingResult();
return ResponseData.fail500Response(e.getMessage()); List<FieldError> fieldErrors = result.getFieldErrors();
StringBuilder sb = new StringBuilder();
for (org.springframework.validation.FieldError fieldError: fieldErrors) {
sb.append(fieldError.getDefaultMessage());
}
return ResponseData.fail400Response(sb.toString());
} }
@ExceptionHandler(HttpRequestMethodNotSupportedException.class) @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
......
...@@ -3,11 +3,11 @@ spring: ...@@ -3,11 +3,11 @@ spring:
active: dev active: dev
application: application:
name: score-console name: score-console
http: servlet:
multipart: multipart:
max-file-size: 50MB
max-request-size: 50MB
enabled: true enabled: true
maxFileSize: 200MB
maxRequestSize: 200MB
swagger: swagger:
enable: true enable: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment