服务调整
这个提交包含在:
父节点
3b4ae6e5e8
当前提交
56e8394eec
9
pom.xml
9
pom.xml
@ -51,6 +51,13 @@
|
|||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>8.0.24</version>
|
<version>8.0.24</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--引入jwt-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.auth0</groupId>
|
||||||
|
<artifactId>java-jwt</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
@ -63,7 +70,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>29.0-jre</version>
|
<version>32.0.0-android</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -0,0 +1,52 @@
|
|||||||
|
package com.xuqm.server.appmanager.common;
|
||||||
|
|
||||||
|
import com.auth0.jwt.JWT;
|
||||||
|
import com.auth0.jwt.JWTCreator;
|
||||||
|
import com.auth0.jwt.algorithms.Algorithm;
|
||||||
|
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||||
|
import com.xuqm.server.appmanager.entitys.UserInfo;
|
||||||
|
import com.xuqm.server.appmanager.entitys.sys.v1.TenantUserEntity;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class JWTHelper {
|
||||||
|
//定义自己的密钥
|
||||||
|
private static final String TOKEN = "token!DASD(#$dsad%$#.";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成token
|
||||||
|
*
|
||||||
|
* @param user 传入的有效负荷
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String genToken(TenantUserEntity user) {
|
||||||
|
JWTCreator.Builder builder = JWT.create();
|
||||||
|
builder.withClaim("userId", user.getUserId());
|
||||||
|
builder.withClaim("tenantNo", user.getTenantNo());
|
||||||
|
Calendar instance = Calendar.getInstance();
|
||||||
|
//定义过期时间
|
||||||
|
instance.add(Calendar.DATE, 7);
|
||||||
|
builder.withExpiresAt(instance.getTime());
|
||||||
|
return builder.sign(Algorithm.HMAC256(TOKEN));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证获取token中的有效负载,验证失败返回null
|
||||||
|
*
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static DecodedJWT verify(String token) {
|
||||||
|
return JWT.require(Algorithm.HMAC256(TOKEN)).build().verify(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UserInfo getUser(String token) {
|
||||||
|
DecodedJWT jwt = null;
|
||||||
|
try {
|
||||||
|
jwt = JWTHelper.verify(token);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new UserInfo(jwt.getClaim("userId").asString(), jwt.getClaim("tenantNo").asString());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.org.bjca.trust.java.imserver.common;
|
package com.xuqm.server.appmanager.common;
|
||||||
|
|
||||||
import org.springframework.aop.framework.AopContext;
|
import org.springframework.aop.framework.AopContext;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.org.bjca.trust.java.imserver.common;
|
package com.xuqm.server.appmanager.common;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.xuqm.server.appmanager.controller.sys.v1;
|
package com.xuqm.server.appmanager.controller.sys.v1;
|
||||||
|
|
||||||
import cn.org.bjca.trust.java.imserver.common.TimeHelper;
|
import com.xuqm.server.appmanager.common.JWTHelper;
|
||||||
|
import com.xuqm.server.appmanager.common.TimeHelper;
|
||||||
|
import com.xuqm.server.appmanager.entitys.UserInfo;
|
||||||
import com.xuqm.server.appmanager.entitys.sys.v1.ApplicationEntity;
|
import com.xuqm.server.appmanager.entitys.sys.v1.ApplicationEntity;
|
||||||
import com.xuqm.server.appmanager.entitys.sys.v1.TenantEntity;
|
import com.xuqm.server.appmanager.entitys.sys.v1.TenantEntity;
|
||||||
import com.xuqm.server.appmanager.entitys.sys.v1.TenantUserEntity;
|
import com.xuqm.server.appmanager.entitys.sys.v1.TenantUserEntity;
|
||||||
@ -9,11 +11,9 @@ import com.xuqm.server.appmanager.repository.sys.v1.ApplicationRepository;
|
|||||||
import com.xuqm.server.appmanager.repository.sys.v1.TenantRepository;
|
import com.xuqm.server.appmanager.repository.sys.v1.TenantRepository;
|
||||||
import com.xuqm.server.appmanager.repository.sys.v1.TenantUserRepository;
|
import com.xuqm.server.appmanager.repository.sys.v1.TenantUserRepository;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@ -29,9 +29,7 @@ public class TenantV1Controller {
|
|||||||
|
|
||||||
@PostMapping("/tenant/create")
|
@PostMapping("/tenant/create")
|
||||||
public HttpResult<String> tenantCreate(@RequestBody TenantUserEntity tenant) throws Exception {
|
public HttpResult<String> tenantCreate(@RequestBody TenantUserEntity tenant) throws Exception {
|
||||||
if (null == tenant.getUserPhone() ||
|
if (null == tenant.getUserPhone() || null == tenant.getUserEmail() || null == tenant.getUserPwd()) {
|
||||||
null == tenant.getUserEmail() ||
|
|
||||||
null == tenant.getUserPwd()) {
|
|
||||||
return new HttpResult<>(201, "参数错误", null);
|
return new HttpResult<>(201, "参数错误", null);
|
||||||
} else {
|
} else {
|
||||||
TenantUserEntity u = tenantUserRepository.findFirstByUserEmailOrUserPhone(tenant.getUserEmail(), tenant.getUserPhone());
|
TenantUserEntity u = tenantUserRepository.findFirstByUserEmailOrUserPhone(tenant.getUserEmail(), tenant.getUserPhone());
|
||||||
@ -53,23 +51,42 @@ public class TenantV1Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/app/create")
|
@PostMapping("/manager/create")
|
||||||
public HttpResult<String> appCreate(@RequestBody ApplicationEntity application) throws Exception {
|
public HttpResult<String> appCreate(@RequestBody ApplicationEntity application, @RequestHeader(name = "token") String token) throws Exception {
|
||||||
if (null == application.getAppName() ||
|
if (null == application.getAppName() || null == application.getPackageName()) {
|
||||||
null == application.getTenantNo()) {
|
|
||||||
return new HttpResult<>(201, "参数错误", null);
|
return new HttpResult<>(201, "参数错误", null);
|
||||||
} else {
|
} else {
|
||||||
ApplicationEntity app = applicationRepository.findFirstByAppNameAndTenantNo(application.getAppName(), application.getTenantNo());
|
UserInfo userInfo = JWTHelper.getUser(token);
|
||||||
|
if (null == userInfo) {
|
||||||
|
return new HttpResult<>(401, "登录失效", null);
|
||||||
|
}
|
||||||
|
ApplicationEntity app = applicationRepository.findFirstByAppNameAndTenantNo(application.getAppName(), userInfo.getTenantNo());
|
||||||
if (null != app) return new HttpResult<>(201, "已创建相关类型的同名应用", null);
|
if (null != app) return new HttpResult<>(201, "已创建相关类型的同名应用", null);
|
||||||
app = new ApplicationEntity();
|
app = new ApplicationEntity();
|
||||||
app.setTenantNo(application.getTenantNo());
|
app.setTenantNo(userInfo.getTenantNo());
|
||||||
app.setAppName(application.getAppName());
|
app.setAppName(application.getAppName());
|
||||||
|
app.setPackageName(application.getPackageName());
|
||||||
|
app.setDownloadUrl(application.getDownloadUrl());
|
||||||
app.setAppId(TimeHelper.getTimeString("yyyyMMddHHmm") + (new Random().nextInt(899999999) + 100000000));
|
app.setAppId(TimeHelper.getTimeString("yyyyMMddHHmm") + (new Random().nextInt(899999999) + 100000000));
|
||||||
applicationRepository.save(app);
|
applicationRepository.save(app);
|
||||||
|
|
||||||
return new HttpResult<>(200, "创建成功", "创建成功");
|
return new HttpResult<>(200, "创建成功", app.getAppId());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/manager/list")
|
||||||
|
public HttpResult<List<ApplicationEntity>> appList(@RequestBody ApplicationEntity application, @RequestHeader(name = "token") String token) throws Exception {
|
||||||
|
|
||||||
|
UserInfo userInfo = JWTHelper.getUser(token);
|
||||||
|
if (null == userInfo) {
|
||||||
|
return new HttpResult<>(401, "登录失效", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<ApplicationEntity> apps = applicationRepository.findAllByTenantNo(userInfo.getTenantNo());
|
||||||
|
|
||||||
|
return new HttpResult<>(200, "成功", apps);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.xuqm.server.appmanager.controller.user.v1;
|
||||||
|
|
||||||
|
import com.xuqm.server.appmanager.common.JWTHelper;
|
||||||
|
import com.xuqm.server.appmanager.entitys.UserLogin;
|
||||||
|
import com.xuqm.server.appmanager.entitys.sys.v1.TenantUserEntity;
|
||||||
|
import com.xuqm.server.appmanager.http.HttpResult;
|
||||||
|
import com.xuqm.server.appmanager.repository.sys.v1.ApplicationRepository;
|
||||||
|
import com.xuqm.server.appmanager.repository.sys.v1.TenantRepository;
|
||||||
|
import com.xuqm.server.appmanager.repository.sys.v1.TenantUserRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("user/v1")
|
||||||
|
public class UserV1Controller {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TenantRepository tenantRepository;
|
||||||
|
@Autowired
|
||||||
|
private TenantUserRepository tenantUserRepository;
|
||||||
|
@Autowired
|
||||||
|
private ApplicationRepository applicationRepository;
|
||||||
|
|
||||||
|
@PostMapping("/login")
|
||||||
|
public HttpResult<String> userLogin(@RequestBody UserLogin user) throws Exception {
|
||||||
|
if (null == user.getEmail() ||
|
||||||
|
null == user.getPassword()) {
|
||||||
|
return new HttpResult<>(201, "参数错误", null);
|
||||||
|
} else {
|
||||||
|
TenantUserEntity u = tenantUserRepository.findFirstByUserEmailAndUserPwd(user.getEmail(), user.getPassword());
|
||||||
|
|
||||||
|
if (u == null) {
|
||||||
|
return new HttpResult<>(501, "用户名或密码错误", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new HttpResult<>(200, "登录成功", JWTHelper.genToken(u));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.xuqm.server.appmanager.entitys;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserInfo {
|
||||||
|
private String userId;
|
||||||
|
private String tenantNo;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.xuqm.server.appmanager.entitys;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserLogin {
|
||||||
|
private String email;
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
@ -1,16 +1,18 @@
|
|||||||
package com.xuqm.server.appmanager.entitys.sys.v1;
|
package com.xuqm.server.appmanager.entitys.sys.v1;
|
||||||
|
|
||||||
import com.xuqm.server.appmanager.entitys.converter.AbstractBaseTimeEntity;
|
import com.xuqm.server.appmanager.entitys.converter.AbstractBaseTimeEntity;
|
||||||
|
import com.xuqm.server.appmanager.enums.AppType;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "applications")
|
@Table(name = "application_release")
|
||||||
@Data
|
@Data
|
||||||
public class ApplicationEntity extends AbstractBaseTimeEntity {
|
public class ApplicationEntity extends AbstractBaseTimeEntity {
|
||||||
private String appId;
|
private String appId;
|
||||||
private String appName;
|
private String appName;
|
||||||
private String tenantNo;
|
private String tenantNo;
|
||||||
private String userId;
|
private String downloadUrl;
|
||||||
|
private String packageName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.xuqm.server.appmanager.entitys.sys.v1;
|
||||||
|
|
||||||
|
import com.xuqm.server.appmanager.entitys.converter.AbstractBaseTimeEntity;
|
||||||
|
import com.xuqm.server.appmanager.enums.AppStatus;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "release")
|
||||||
|
@Data
|
||||||
|
public class ReleaseEntity extends AbstractBaseTimeEntity {
|
||||||
|
private String appId;
|
||||||
|
private AppStatus huawei;
|
||||||
|
private AppStatus xiaomi;
|
||||||
|
private AppStatus meizu;
|
||||||
|
private AppStatus rongyao;
|
||||||
|
private AppStatus oppo;
|
||||||
|
private AppStatus vivo;
|
||||||
|
private AppStatus google;
|
||||||
|
private String url;
|
||||||
|
private String versionCode;
|
||||||
|
private String versionName;
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xuqm.server.appmanager.entitys.sys.v1;
|
package com.xuqm.server.appmanager.entitys.sys.v1;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.xuqm.server.appmanager.entitys.converter.AbstractBaseTimeEntity;
|
import com.xuqm.server.appmanager.entitys.converter.AbstractBaseTimeEntity;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
@ -13,6 +14,7 @@ public class TenantUserEntity extends AbstractBaseTimeEntity {
|
|||||||
private String userName;
|
private String userName;
|
||||||
private String userPhone;
|
private String userPhone;
|
||||||
private String userEmail;
|
private String userEmail;
|
||||||
|
@JsonIgnore
|
||||||
private String userPwd;
|
private String userPwd;
|
||||||
private String tenantNo;
|
private String tenantNo;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.xuqm.server.appmanager.enums;
|
||||||
|
|
||||||
|
public enum AppStatus {
|
||||||
|
// 不需要发布、没有上传安装包、已上传待审核、审核完成待发布、已发布
|
||||||
|
NOT(0),ABSENT(1), AUDIT(2), WAIT(3), RELEASE(4) ;
|
||||||
|
private int status = 0;
|
||||||
|
|
||||||
|
AppStatus(final int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int status() {
|
||||||
|
return this.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AppStatus getStatus(final int status) {
|
||||||
|
for (final AppStatus value : AppStatus.values()) {
|
||||||
|
if (value.status == status) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NOT;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.xuqm.server.appmanager.enums;
|
||||||
|
|
||||||
|
public enum AppType {
|
||||||
|
UNKNOWN(0),IM(1), APP(2) ;
|
||||||
|
private int type = -1;
|
||||||
|
|
||||||
|
AppType(final int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int type() {
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AppType getType(final int type) {
|
||||||
|
for (final AppType value : AppType.values()) {
|
||||||
|
if (value.type == type) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.xuqm.server.appmanager.interceptor;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class InterceptorConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
registry.addInterceptor(new JWTInterceptor())
|
||||||
|
//其他接口token验证
|
||||||
|
.addPathPatterns("/**")
|
||||||
|
//所有用户都放心
|
||||||
|
.excludePathPatterns("/tenant/create","/user/v1/login","/hello/**");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.xuqm.server.appmanager.interceptor;
|
||||||
|
|
||||||
|
import com.auth0.jwt.exceptions.AlgorithmMismatchException;
|
||||||
|
import com.auth0.jwt.exceptions.SignatureVerificationException;
|
||||||
|
import com.auth0.jwt.exceptions.TokenExpiredException;
|
||||||
|
import com.xuqm.server.appmanager.common.JWTHelper;
|
||||||
|
import com.xuqm.server.appmanager.common.json.GsonImplHelp;
|
||||||
|
import com.xuqm.server.appmanager.http.HttpResult;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
|
public class JWTInterceptor implements HandlerInterceptor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||||
|
String msg = "";
|
||||||
|
//获取请求头中令牌
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
try {
|
||||||
|
JWTHelper.verify(token);//验证令牌
|
||||||
|
return true;//放行请求
|
||||||
|
} catch (SignatureVerificationException e) {
|
||||||
|
msg = "无效签名!";
|
||||||
|
} catch (TokenExpiredException e) {
|
||||||
|
msg = "token过期!";
|
||||||
|
} catch (AlgorithmMismatchException e) {
|
||||||
|
msg = "token算法不一致!";
|
||||||
|
} catch (Exception e) {
|
||||||
|
msg = "token无效!!";
|
||||||
|
}
|
||||||
|
HttpResult<String> result = new HttpResult<>(401, msg, null);
|
||||||
|
//将map 专为json jackson
|
||||||
|
response.setContentType("application/json;charset=UTF-8");
|
||||||
|
response.getWriter().println(GsonImplHelp.get().toJson(result));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,12 +1,15 @@
|
|||||||
package com.xuqm.server.appmanager.repository.sys.v1;
|
package com.xuqm.server.appmanager.repository.sys.v1;
|
||||||
|
|
||||||
import com.xuqm.server.appmanager.entitys.sys.v1.ApplicationEntity;
|
import com.xuqm.server.appmanager.entitys.sys.v1.ApplicationEntity;
|
||||||
|
import com.xuqm.server.appmanager.enums.AppType;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface ApplicationRepository extends JpaRepository<ApplicationEntity, Long> {
|
public interface ApplicationRepository extends JpaRepository<ApplicationEntity, Long> {
|
||||||
ApplicationEntity findFirstByAppNameAndTenantNo(String appName, String tenantNo);
|
ApplicationEntity findFirstByAppNameAndTenantNo(String appName, String tenantNo);
|
||||||
ApplicationEntity findFirstByAppId(String appId);
|
List<ApplicationEntity> findAllByTenantNo(String tenantNo);
|
||||||
boolean existsByAppId(String appId);
|
boolean existsByAppId(String appId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,5 +8,6 @@ import org.springframework.stereotype.Repository;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface TenantUserRepository extends JpaRepository<TenantUserEntity, Long> {
|
public interface TenantUserRepository extends JpaRepository<TenantUserEntity, Long> {
|
||||||
TenantUserEntity findFirstByUserEmailOrUserPhone(String userEmail, String userPhone);
|
TenantUserEntity findFirstByUserEmailOrUserPhone(String userEmail, String userPhone);
|
||||||
|
TenantUserEntity findFirstByUserEmailAndUserPwd(String userEmail, String userPwd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,11 +4,11 @@ server.port=4562
|
|||||||
#????????????
|
#????????????
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
#mysql?????????????
|
#mysql?????????????
|
||||||
spring.datasource.url = jdbc:mysql://114.115.203.60:3306/app-manager?serverTimezone=Asia/Shanghai
|
spring.datasource.url = jdbc:mysql://39.107.53.187:3306/app-manager?serverTimezone=Asia/Shanghai
|
||||||
#??????
|
#??????
|
||||||
spring.datasource.username = app-manager
|
spring.datasource.username = app-manager
|
||||||
#?????
|
#?????
|
||||||
spring.datasource.password = hjCcSd43pkxbdCHX
|
spring.datasource.password = x2XSX47tBtiAhxCz
|
||||||
#mysql???????????
|
#mysql???????????
|
||||||
spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver
|
||||||
#jpa?????????Hibernate?sql(??)
|
#jpa?????????Hibernate?sql(??)
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户