NeedBraceRule解决

This commit is contained in:
dftre 2025-01-07 11:50:45 +08:00
parent 7b9a801b2e
commit 6496ae7000
4 changed files with 15 additions and 11 deletions

View File

@ -26,7 +26,7 @@ import io.swagger.v3.oas.models.media.StringSchema;
public class SwaggerConfig { public class SwaggerConfig {
@Bean @Bean
public OpenAPI springShopOpenAPI() { public OpenAPI springShopOpenApi() {
Schema<?> codeSchema = new IntegerSchema().example(HttpStatus.SUCCESS); // 示例状态码 Schema<?> codeSchema = new IntegerSchema().example(HttpStatus.SUCCESS); // 示例状态码
Schema<?> msgSchema = new StringSchema().example("操作成功"); // 示例消息 Schema<?> msgSchema = new StringSchema().example("操作成功"); // 示例消息
ObjectSchema dataSchema = new ObjectSchema(); // 数据可以是任意类型这里简单定义为ObjectSchema ObjectSchema dataSchema = new ObjectSchema(); // 数据可以是任意类型这里简单定义为ObjectSchema

View File

@ -6,13 +6,13 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.auth.common.domain.OauthUser;
import com.ruoyi.auth.common.service.IOauthUserService;
import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.auth.common.domain.OauthUser;
import com.ruoyi.auth.common.service.IOauthUserService;
import com.ruoyi.oauth.wx.constant.WxMiniAppConstant; import com.ruoyi.oauth.wx.constant.WxMiniAppConstant;
import com.ruoyi.oauth.wx.constant.WxPubConstant; import com.ruoyi.oauth.wx.constant.WxPubConstant;
import com.ruoyi.oauth.wx.service.Impl.WxLoginServiceImpl; import com.ruoyi.oauth.wx.service.Impl.WxLoginServiceImpl;
@ -37,9 +37,10 @@ public class WxLoginController extends BaseController {
public AjaxResult loginMiniApp(@PathVariable("source") String source, @PathVariable("code") String code) { public AjaxResult loginMiniApp(@PathVariable("source") String source, @PathVariable("code") String code) {
String token = null; String token = null;
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
if ("miniapp".equals(source)) if ("miniapp".equals(source)) {
token = wxLoginServiceImpl.doLoginMiniApp(code); token = wxLoginServiceImpl.doLoginMiniApp(code);
else if ("pub".equals(source)) {
} else if ("pub".equals(source)) {
token = wxLoginServiceImpl.doLoginPub(code); token = wxLoginServiceImpl.doLoginPub(code);
} else { } else {
return error("错误的登录方式"); return error("错误的登录方式");
@ -58,9 +59,9 @@ public class WxLoginController extends BaseController {
oauthUser = new OauthUser(); oauthUser = new OauthUser();
oauthUser.setUserId(getUserId()); oauthUser.setUserId(getUserId());
oauthUser.setCode(code); oauthUser.setCode(code);
if ("miniapp".equals(source)) if ("miniapp".equals(source)) {
msg = wxLoginServiceImpl.doRegisterMiniApp(oauthUser); msg = wxLoginServiceImpl.doRegisterMiniApp(oauthUser);
else if ("pub".equals(source)) { } else if ("pub".equals(source)) {
msg = wxLoginServiceImpl.doRegisterPub(oauthUser); msg = wxLoginServiceImpl.doRegisterPub(oauthUser);
} else { } else {
return error("错误的注册方式"); return error("错误的注册方式");

View File

@ -33,8 +33,9 @@ public class TableInfo {
public TableInfo(Class<?> cls) { public TableInfo(Class<?> cls) {
this.table = AnnotationUtils.findAnnotation(cls, Table.class); this.table = AnnotationUtils.findAnnotation(cls, Table.class);
if (this.table == null) if (this.table == null) {
throw new RuntimeException("error , not find tableName"); throw new RuntimeException("error , not find tableName");
}
this.tableName = this.table.name(); this.tableName = this.table.name();
this.enableTableMap = AnnotationUtils.findAnnotation(cls, EnableTableMap.class); this.enableTableMap = AnnotationUtils.findAnnotation(cls, EnableTableMap.class);
@ -118,11 +119,12 @@ public class TableInfo {
} }
public String getTableNameFrom() { public String getTableNameFrom() {
if (this.isEnbleMap()) if (this.isEnbleMap()){
return this.tableName + " " + this.enableTableMap.name(); return this.tableName + " " + this.enableTableMap.name();
else }else{
return this.tableName; return this.tableName;
} }
}
public List<String> getQueryColumnNames() { public List<String> getQueryColumnNames() {
List<String> columns = Arrays.asList(this.table.columns()); List<String> columns = Arrays.asList(this.table.columns());

View File

@ -22,8 +22,9 @@ public class TableContainer {
public static <T extends BaseEntity> TableInfo getTableInfo(Class<?> clazz) { public static <T extends BaseEntity> TableInfo getTableInfo(Class<?> clazz) {
TableInfo tableInfo = tableInfoMap.get(clazz); TableInfo tableInfo = tableInfoMap.get(clazz);
if (tableInfo == null) if (tableInfo == null) {
tableInfo = new TableInfo(clazz); tableInfo = new TableInfo(clazz);
}
return tableInfo; return tableInfo;
} }