Compare commits

..

No commits in common. "c87a34dd3a2626e94c3514ac110b0c0a321da4a6" and "dab7059542724775cf80d290b1468672ba44aa1a" have entirely different histories.

12 changed files with 0 additions and 168 deletions

View File

@ -116,12 +116,6 @@
<artifactId>yudao-spring-boot-starter-monitor</artifactId> <artifactId>yudao-spring-boot-starter-monitor</artifactId>
</dependency> </dependency>
<!-- feign客户端 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<!-- 设置构建的 jar 包名 --> <!-- 设置构建的 jar 包名 -->

View File

@ -2,13 +2,11 @@ package cn.iocoder.yudao.module.datacenter;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
/** /**
* @Description 大屏服务启动类 * @Description 大屏服务启动类
*/ */
@SpringBootApplication @SpringBootApplication
@EnableFeignClients
public class DatacenterServerApplication { public class DatacenterServerApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(DatacenterServerApplication.class, args); SpringApplication.run(DatacenterServerApplication.class, args);

View File

@ -1,7 +1,5 @@
package cn.iocoder.yudao.module.datacenter.controller.app.checkticket; package cn.iocoder.yudao.module.datacenter.controller.app.checkticket;
import cn.iocoder.yudao.module.datacenter.controller.app.clients.LoginClient;
import cn.iocoder.yudao.module.datacenter.controller.app.clients.vo.AuthLoginReqVO;
import cn.iocoder.yudao.module.datacenter.service.checkticket.CheckTicketService; import cn.iocoder.yudao.module.datacenter.service.checkticket.CheckTicketService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -22,10 +20,6 @@ import java.util.Map;
public class CheckTicketApi { public class CheckTicketApi {
@Resource @Resource
private CheckTicketService checkTicketService; private CheckTicketService checkTicketService;
@Resource
private LoginClient loginClient;
@GetMapping() @GetMapping()
@Operation(summary = "获得日期当天的检票人数") @Operation(summary = "获得日期当天的检票人数")
public Long checkTicketTotal(String starTime, String endTime) { public Long checkTicketTotal(String starTime, String endTime) {
@ -41,13 +35,4 @@ public class CheckTicketApi {
String replace1 = endTime.replace("-", ""); String replace1 = endTime.replace("-", "");
return checkTicketService.findbytimetemp(replace,replace1); return checkTicketService.findbytimetemp(replace,replace1);
} }
@GetMapping("/getToken")
public Map<Object, Object> test(){
AuthLoginReqVO loginReqVO = new AuthLoginReqVO();
loginReqVO.setPassword("admin123");
loginReqVO.setUsername("admin");
Map<Object, Object> token = loginClient.getToken(loginReqVO,"1");
return token;
}
} }

View File

@ -1,16 +0,0 @@
package cn.iocoder.yudao.module.datacenter.controller.app.clients;
import cn.iocoder.yudao.module.datacenter.controller.app.clients.vo.AuthLoginReqVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.Map;
@FeignClient("system-server")
public interface LoginClient {
@PostMapping("/admin-api/system/auth/login")
Map<Object,Object> getToken(@RequestBody AuthLoginReqVO reqVO, @RequestHeader("Tenant-Id") String tenantId);
}

View File

@ -1,69 +0,0 @@
package cn.iocoder.yudao.module.datacenter.controller.app.clients.vo;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
@Schema(description = "管理后台 - 账号密码登录 Request VO如果登录并绑定社交用户需要传递 social 开头的参数")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AuthLoginReqVO {
@Schema(description = "账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudaoyuanma")
@NotEmpty(message = "登录账号不能为空")
@Length(min = 4, max = 16, message = "账号长度为 4-16 位")
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
private String username;
@Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "buzhidao")
@NotEmpty(message = "密码不能为空")
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
private String password;
// ========== 图片验证码相关 ==========
@Schema(description = "验证码,验证码开启时,需要传递", requiredMode = Schema.RequiredMode.REQUIRED,
example = "PfcH6mgr8tpXuMWFjvW6YVaqrswIuwmWI5dsVZSg7sGpWtDCUbHuDEXl3cFB1+VvCC/rAkSwK8Fad52FSuncVg==")
@NotEmpty(message = "验证码不能为空", groups = CodeEnableGroup.class)
private String captchaVerification;
// ========== 绑定社交登录时需要传递如下参数 ==========
@Schema(description = "社交平台的类型,参见 SocialTypeEnum 枚举值", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
@InEnum(SocialTypeEnum.class)
private Integer socialType;
@Schema(description = "授权码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private String socialCode;
@Schema(description = "state", requiredMode = Schema.RequiredMode.REQUIRED, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
private String socialState;
/**
* 开启验证码的 Group
*/
public interface CodeEnableGroup {}
@AssertTrue(message = "授权码不能为空")
public boolean isSocialCodeValid() {
return socialType == null || StrUtil.isNotEmpty(socialCode);
}
@AssertTrue(message = "授权 state 不能为空")
public boolean isSocialState() {
return socialType == null || StrUtil.isNotEmpty(socialState);
}
}

View File

@ -57,20 +57,14 @@ public class CheckTicketServiceImpl implements CheckTicketService {
countMap.put("map"+String.format("%02d", Integer.parseInt(i+"")),0); countMap.put("map"+String.format("%02d", Integer.parseInt(i+"")),0);
} }
//查询该时间区域的所有数据 //查询该时间区域的所有数据
long s1 = System.currentTimeMillis();
List<CheckTicket> allByCheckticketdateBetween = checkTicketRepository.findAllByCheckticketdateBetween(starTime, this.publicMethod(endTime)); List<CheckTicket> allByCheckticketdateBetween = checkTicketRepository.findAllByCheckticketdateBetween(starTime, this.publicMethod(endTime));
long s2 = System.currentTimeMillis();
System.out.println("1-------------------------"+(s2-s1));
//分析数据 //分析数据
long s3 = System.currentTimeMillis();
for (CheckTicket checkTicket : allByCheckticketdateBetween) { for (CheckTicket checkTicket : allByCheckticketdateBetween) {
String checktickettime = checkTicket.getChecktickettime(); String checktickettime = checkTicket.getChecktickettime();
String result = checktickettime.substring(0, 2); String result = checktickettime.substring(0, 2);
Integer numberCount = countMap.get("map" + result); Integer numberCount = countMap.get("map" + result);
countMap.put("map" + result, numberCount+1); countMap.put("map" + result, numberCount+1);
} }
long s4 = System.currentTimeMillis();
System.out.println("2--------------------------"+(s4-s3));
//构造数据结构 //构造数据结构
LocalDateTime startTime = LocalDateTime.now(); LocalDateTime startTime = LocalDateTime.now();

View File

@ -164,12 +164,6 @@
<artifactId>tika-core</artifactId> <!-- 文件客户端:文件类型的识别 --> <artifactId>tika-core</artifactId> <!-- 文件客户端:文件类型的识别 -->
</dependency> </dependency>
<!-- feign客户端 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<!-- 设置构建的 jar 包名 --> <!-- 设置构建的 jar 包名 -->

View File

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.infra;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
/** /**
* 项目的启动类 * 项目的启动类
@ -14,7 +13,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
* @author 芋道源码 * @author 芋道源码
*/ */
@SpringBootApplication @SpringBootApplication
@EnableFeignClients
public class InfraServerApplication { public class InfraServerApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -1,13 +0,0 @@
package cn.iocoder.yudao.module.infra.clients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
import java.util.Map;
@FeignClient("datacenter-server")
public interface LargeScreenClient {
@GetMapping("/api/asset/type")
List<Object> assetMethod1();
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.infra.job.largeScreenHeartbeat;
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
import cn.iocoder.yudao.module.infra.clients.LargeScreenClient;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Component
public class LargeScreenHeartbeat {
@Resource
private WebSocketSenderApi webSocketSenderApi;
@Resource
private LargeScreenClient largeScreenClient;
@XxlJob("largeScreen")
public void largeScreenToWebSocket(){
List<Object> maps = largeScreenClient.assetMethod1();
webSocketSenderApi.sendObject(1,"1",maps);
}
}

View File

@ -67,9 +67,6 @@ public class AuthController {
@PermitAll @PermitAll
@Operation(summary = "使用账号密码登录") @Operation(summary = "使用账号密码登录")
public CommonResult<AuthLoginRespVO> login(@RequestBody @Valid AuthLoginReqVO reqVO) { public CommonResult<AuthLoginRespVO> login(@RequestBody @Valid AuthLoginReqVO reqVO) {
// AuthLoginReqVO loginReqVO = new AuthLoginReqVO();
// loginReqVO.setPassword("admin123");
// loginReqVO.setUsername("admin");
return success(authService.login(reqVO)); return success(authService.login(reqVO));
} }

View File

@ -30,8 +30,6 @@ public class SecurityConfiguration {
.antMatchers("/actuator/**").anonymous(); .antMatchers("/actuator/**").anonymous();
// RPC 服务的安全配置 // RPC 服务的安全配置
registry.antMatchers(ApiConstants.PREFIX + "/**").permitAll(); registry.antMatchers(ApiConstants.PREFIX + "/**").permitAll();
//登录接口
registry.antMatchers("/system/auth/login").permitAll();
} }
}; };