1.change getSupportedCountryCode response from List<String> to List<CountryCodeDTO>

main
Gary 10 months ago
parent 43b25f1b5b
commit 1fdf6fe77c

@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
import constants.Constants; import constants.Constants;
import controller.BaseController; import controller.BaseController;
import com.luoo.user.dto.response.CountryCodeDTO;
import com.luoo.user.dto.response.CreateImageCode; import com.luoo.user.dto.response.CreateImageCode;
import com.luoo.user.pojo.UserInfo; import com.luoo.user.pojo.UserInfo;
import com.luoo.user.service.UserInfoService; import com.luoo.user.service.UserInfoService;
@ -46,7 +47,7 @@ import util.StringTools;
@RequestMapping("/user") @RequestMapping("/user")
@Api(tags = "LoginController") @Api(tags = "LoginController")
public class LoginController extends BaseController{ public class LoginController extends BaseController{
private static final List<String> DEFAULT_SUPPORTED_COUNTRY_CODES=Arrays.asList("+86"); private static final List<CountryCodeDTO> DEFAULT_SUPPORTED_COUNTRY_CODES=Arrays.asList(new CountryCodeDTO("中国","+86"));
@Autowired @Autowired
private UserInfoService userInfoService; private UserInfoService userInfoService;
@ -182,8 +183,7 @@ public class LoginController extends BaseController{
*/ */
@ApiOperation(value = "6.获取支持的手机号国家码", notes = "v1仅支持'+86'") @ApiOperation(value = "6.获取支持的手机号国家码", notes = "v1仅支持'+86'")
@GetMapping("/supportedCountryCode") @GetMapping("/supportedCountryCode")
@GlobalInterceptor public Result<List<CountryCodeDTO>> getSupportedCountryCode(){
public Result<List<String>> getSupportedCountryCode(){
return Result.success(DEFAULT_SUPPORTED_COUNTRY_CODES); return Result.success(DEFAULT_SUPPORTED_COUNTRY_CODES);
} }
} }

@ -0,0 +1,17 @@
package com.luoo.user.dto.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CountryCodeDTO {
@ApiModelProperty(value = "国家名", example = "中国")
private String countryName;
@ApiModelProperty(value = "国际电话区号", example = "+86")
private String countryCode;
public CountryCodeDTO(String countryName, String countryCode) {
this.countryName = countryName;
this.countryCode = countryCode;
}
}
Loading…
Cancel
Save