This commit is contained in:
parent
d0f2f7a9e2
commit
b32de0ba2f
|
|
@ -4,6 +4,9 @@ import java.net.URI;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
import org.apache.commons.codec.binary.Base64;
|
import org.apache.commons.codec.binary.Base64;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
@ -40,12 +43,13 @@ public class Hgt8Component{
|
||||||
public static Browser browser;
|
public static Browser browser;
|
||||||
public static HashMap<String, Hgt8Component> instances = new HashMap<String, Hgt8Component>();
|
public static HashMap<String, Hgt8Component> instances = new HashMap<String, Hgt8Component>();
|
||||||
public static Boolean headless;
|
public static Boolean headless;
|
||||||
public static Long defaultTimeout = 6000L;
|
public static Long defaultTimeout = 10000L;
|
||||||
|
|
||||||
public BrowserContext browserContext;
|
public BrowserContext browserContext;
|
||||||
public APIRequestContext aPIRequestContext;
|
public APIRequestContext aPIRequestContext;
|
||||||
public Page page;
|
public Page page;
|
||||||
public Idc9998AdminInfo admin;
|
public Idc9998AdminInfo admin;
|
||||||
|
public AtomicInteger wrong_times = new AtomicInteger(0);
|
||||||
|
|
||||||
|
|
||||||
@Autowired Idc9998Sevice idc9998Sevice;
|
@Autowired Idc9998Sevice idc9998Sevice;
|
||||||
|
|
@ -73,8 +77,10 @@ public class Hgt8Component{
|
||||||
.setHeadless(headless)
|
.setHeadless(headless)
|
||||||
.setSlowMo(200)
|
.setSlowMo(200)
|
||||||
);
|
);
|
||||||
// Idc9998AdminInfo admin = idc9998Sevice.getByUserName("bk7897");
|
|
||||||
// this.addInstance(admin.getUser_name());
|
Idc9998AdminInfo admin = idc9998Sevice.getByUserName("bk7897");
|
||||||
|
this.addInstance(admin.getUser_name());
|
||||||
|
|
||||||
logger.info("playwright started");
|
logger.info("playwright started");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,7 +147,7 @@ public class Hgt8Component{
|
||||||
|
|
||||||
|
|
||||||
public Boolean login() {
|
public Boolean login() {
|
||||||
if(this.admin.getIs_online() == 1) {
|
if(this.admin.getIs_online() != 1) {
|
||||||
return this.forceLogin();
|
return this.forceLogin();
|
||||||
}else {
|
}else {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -180,9 +186,24 @@ public class Hgt8Component{
|
||||||
.locator("xpath=//input[@class='protocol-btn-y']")
|
.locator("xpath=//input[@class='protocol-btn-y']")
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
//关闭弹窗
|
||||||
|
ifr_main.getByTestId("tc_Close")
|
||||||
|
.click();
|
||||||
|
|
||||||
|
this.page.frameLocator("#ifr_main")
|
||||||
|
.locator("xpath=//input[@class='protocol-btn-y']")
|
||||||
|
.click();
|
||||||
|
|
||||||
|
|
||||||
|
this.page.frameLocator("#ifr_main")
|
||||||
|
.locator("#jishi-order")
|
||||||
|
.click();
|
||||||
|
|
||||||
|
|
||||||
Response s = page.waitForResponse(resp -> {
|
Response s = page.waitForResponse(resp -> {
|
||||||
System.out.println(resp.url());
|
System.err.println(resp.url());
|
||||||
if(resp.status() == 200 ) {
|
if(resp.status() == 200 ) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}else {
|
}else {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -214,13 +235,48 @@ public class Hgt8Component{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CompletableFuture<Response> G_24_Curr() {
|
||||||
|
CompletableFuture<Response> future = CompletableFuture.supplyAsync(() -> {
|
||||||
|
Response response = page.waitForResponse(resp -> {
|
||||||
|
System.err.println(resp.url());
|
||||||
|
if(resp.status() == 200 ) {
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() -> {
|
||||||
|
System.out.println("所有返回相应");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return future.handleAsync((Response re, Throwable ex) -> {
|
||||||
|
if(ex != null) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
wrong_times.getAndIncrement();
|
||||||
|
if(wrong_times.get()>3) {
|
||||||
|
return future;
|
||||||
|
}
|
||||||
|
|
||||||
|
return G_24_Curr();
|
||||||
|
} else {
|
||||||
|
return G_24_Curr();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.thenCompose(Function.identity());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void G_24_His(Integer page, String issuet, LocalDate localDate) {
|
public void G_24_His(Integer page, String issuet, LocalDate localDate) {
|
||||||
try {
|
try {
|
||||||
if(this.admin.getIs_online()==1) {
|
if(this.admin.getIs_online()==1) {
|
||||||
HashMap<String, String> pram = new HashMap<String, String>();
|
HashMap<String, String> pram = new HashMap<String, String>();
|
||||||
pram.put("gameID", Games.G_21.getCode());
|
pram.put("gameID", Games.G_24.getCode());
|
||||||
pram.put("currtentPage",page.toString());
|
pram.put("currtentPage",page.toString());
|
||||||
pram.put("asDate",localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
pram.put("asDate",localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||||
pram.put("issuet", "");
|
pram.put("issuet", "");
|
||||||
|
|
|
||||||
|
|
@ -2,149 +2,36 @@ package jj.tech.paolu.biz.webadmin.controller;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import static org.mybatis.dynamic.sql.SqlBuilder.*;
|
|
||||||
|
|
||||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
|
||||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
|
||||||
import org.mybatis.dynamic.sql.select.QueryExpressionDSL;
|
|
||||||
import org.mybatis.dynamic.sql.select.SelectModel;
|
|
||||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
|
||||||
import org.mybatis.dynamic.sql.where.WhereApplier;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jj.tech.paolu.biz.webadmin.component.Hgt8Component;
|
import jj.tech.paolu.biz.webadmin.component.Hgt8Component;
|
||||||
import jj.tech.paolu.biz.webadmin.dao.SelectMapper;
|
import jj.tech.paolu.biz.webadmin.vo.IdPageVo;
|
||||||
import jj.tech.paolu.biz.webadmin.service.G24Service;
|
import jj.tech.paolu.config.enums.Games;
|
||||||
import jj.tech.paolu.biz.webadmin.vo.Id;
|
|
||||||
import jj.tech.paolu.biz.webadmin.vo.Idc9998AdminAddVo;
|
|
||||||
import jj.tech.paolu.biz.webadmin.vo.Idc9998AdminListVo;
|
|
||||||
import jj.tech.paolu.biz.webadmin.vo.Idc9998AdminUpdateVo;
|
|
||||||
import jj.tech.paolu.repository.mybatis.dao.CurrentG24Mapper;
|
import jj.tech.paolu.repository.mybatis.dao.CurrentG24Mapper;
|
||||||
import jj.tech.paolu.repository.mybatis.dao.Idc9998AdminInfoMapper;
|
import jj.tech.paolu.repository.mybatis.dao.HistoryG24Mapper;
|
||||||
import jj.tech.paolu.repository.mybatis.dao.support.Idc9998AdminInfoDynamicSqlSupport;
|
import jj.tech.paolu.repository.mybatis.dao.support.HistoryG24DynamicSqlSupport;
|
||||||
import jj.tech.paolu.repository.mybatis.entity.CurrentG24;
|
import jj.tech.paolu.repository.mybatis.entity.CurrentG24;
|
||||||
|
import jj.tech.paolu.repository.mybatis.entity.HistoryG24;
|
||||||
import jj.tech.paolu.repository.mybatis.entity.Idc9998AdminInfo;
|
import jj.tech.paolu.repository.mybatis.entity.Idc9998AdminInfo;
|
||||||
import jj.tech.paolu.utils.IDHelp;
|
|
||||||
import jj.tech.paolu.utils.Page;
|
import jj.tech.paolu.utils.Page;
|
||||||
import jj.tech.paolu.utils.R;
|
import jj.tech.paolu.utils.R;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "/op/idc9998",name = "导航到hgt8")
|
@RequestMapping(value = "/op/idc9998",name = "游戏报告列表")
|
||||||
|
@Tag(name = "Idc9998Controller", description = "游戏报告列表")
|
||||||
public class Idc9998Controller {
|
public class Idc9998Controller {
|
||||||
|
|
||||||
@Autowired Hgt8Component hgt8Component;
|
|
||||||
@Autowired G24Service g24Service;
|
|
||||||
|
|
||||||
@Autowired SelectMapper selectMapper;
|
|
||||||
@Autowired CurrentG24Mapper currentG24Mapper;
|
@Autowired CurrentG24Mapper currentG24Mapper;
|
||||||
@Autowired Idc9998AdminInfoMapper idc9998AdminInfoMapper;
|
@Autowired HistoryG24Mapper historyG24Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "Idc9998管理列表")
|
|
||||||
@PostMapping("/listAdmin")
|
|
||||||
public Object listAdmin(@Validated @RequestBody Idc9998AdminListVo parame) {
|
|
||||||
|
|
||||||
Page p = new Page(parame.pageNum, parame.pageSize);
|
|
||||||
|
|
||||||
Function<QueryExpressionDSL.FromGatherer<SelectModel>, QueryExpressionDSL<SelectModel>> function =
|
|
||||||
s -> {
|
|
||||||
var from = s
|
|
||||||
.from(Idc9998AdminInfoDynamicSqlSupport.idc9998AdminInfo)
|
|
||||||
;
|
|
||||||
return from;
|
|
||||||
};
|
|
||||||
|
|
||||||
var where = SqlBuilder.where();
|
|
||||||
where.and(Idc9998AdminInfoDynamicSqlSupport.manager_name, isEqualToWhenPresent(parame.manager_name));
|
|
||||||
where.and(Idc9998AdminInfoDynamicSqlSupport.member_name, isEqualToWhenPresent(parame.member_name));
|
|
||||||
where.and(Idc9998AdminInfoDynamicSqlSupport.user_name, isEqualToWhenPresent(parame.user_name));
|
|
||||||
where.and(Idc9998AdminInfoDynamicSqlSupport.user_password, isEqualToWhenPresent(parame.user_password));
|
|
||||||
where.and(Idc9998AdminInfoDynamicSqlSupport.domain, isEqualToWhenPresent(parame.domain));
|
|
||||||
|
|
||||||
WhereApplier applier = where.toWhereApplier();
|
|
||||||
|
|
||||||
SelectStatementProvider provider = function.apply(select(Idc9998AdminInfoMapper.selectList))
|
|
||||||
.applyWhere(applier)
|
|
||||||
.configureStatement(config -> config.setNonRenderingWhereClauseAllowed(true))
|
|
||||||
.groupBy(Idc9998AdminInfoDynamicSqlSupport.id)
|
|
||||||
.orderBy(Idc9998AdminInfoDynamicSqlSupport.id.descending())
|
|
||||||
.limit(p.getPageSize())
|
|
||||||
.offset(p.limitStart())
|
|
||||||
.build()
|
|
||||||
.render(RenderingStrategies.MYBATIS3);
|
|
||||||
|
|
||||||
|
|
||||||
SelectStatementProvider count = select(count())
|
|
||||||
.from(function.apply(select(Idc9998AdminInfoMapper.selectList))
|
|
||||||
.applyWhere(applier)
|
|
||||||
.groupBy(Idc9998AdminInfoDynamicSqlSupport.id)
|
|
||||||
.orderBy(Idc9998AdminInfoDynamicSqlSupport.id.descending()),
|
|
||||||
"t1")
|
|
||||||
.configureStatement(config -> config.setNonRenderingWhereClauseAllowed(true))
|
|
||||||
.build()
|
|
||||||
.render(RenderingStrategies.MYBATIS3);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var list = selectMapper.selectMany(provider);
|
|
||||||
long total = selectMapper.count(count);
|
|
||||||
p.setList(list);
|
|
||||||
p.setTotal(total);
|
|
||||||
return R.SUCCESS(p);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "添加Idc9998管理员信息")
|
|
||||||
@PostMapping("/addAdmin")
|
|
||||||
public Object addAdmin(@Validated @RequestBody Idc9998AdminAddVo parame) {
|
|
||||||
|
|
||||||
Idc9998AdminInfo bean = new Idc9998AdminInfo();
|
|
||||||
BeanUtils.copyProperties(parame, bean);
|
|
||||||
bean.setId(IDHelp.getInstance().nextId());
|
|
||||||
|
|
||||||
idc9998AdminInfoMapper.insertSelective(bean);
|
|
||||||
|
|
||||||
return R.SUCCESS(bean);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "", description = "")
|
|
||||||
@PostMapping("/updateAdmin")
|
|
||||||
public Object updateAdmin(@Validated @RequestBody Idc9998AdminUpdateVo parame) {
|
|
||||||
Idc9998AdminInfo bean = new Idc9998AdminInfo();
|
|
||||||
BeanUtils.copyProperties(parame, bean);
|
|
||||||
idc9998AdminInfoMapper.updateByPrimaryKeySelective(bean);
|
|
||||||
return R.SUCCESS(bean);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "", description = "")
|
|
||||||
@PostMapping("/getAdmin")
|
|
||||||
public Object getAdmin(@Validated @RequestBody Id parame) {
|
|
||||||
|
|
||||||
Idc9998AdminInfo bean =
|
|
||||||
idc9998AdminInfoMapper.selectByPrimaryKey(parame.id).orElse(null);
|
|
||||||
return R.SUCCESS(bean);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "", description = "")
|
|
||||||
@PostMapping("/deleteAdmin")
|
|
||||||
public Object deleteAdmin(@Validated @RequestBody Id parame) {
|
|
||||||
idc9998AdminInfoMapper.deleteByPrimaryKey(parame.id);
|
|
||||||
return R.SUCCESS("ok");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired Hgt8Component hgt8Component;
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "获取最新游戏数据", description = "test")
|
@Operation(summary = "获取最新游戏数据", description = "test")
|
||||||
|
|
@ -160,6 +47,36 @@ public class Idc9998Controller {
|
||||||
return R.SUCCESS(r);
|
return R.SUCCESS(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取历史游戏数据, G_24幸运飞艇,G_29极速时时彩,G_30极速赛车,G_31极速飞艇,G_35澳洲幸运5,G_37澳洲幸运10",
|
||||||
|
description = "test,目前只有G24")
|
||||||
|
@PostMapping("/getHistory")
|
||||||
|
public Object getHistory(IdPageVo parame) {
|
||||||
|
Page p = new Page(parame.pageNum, parame.pageSize);
|
||||||
|
|
||||||
|
if(Games.G_24.getCode().equals(parame.id)) {
|
||||||
|
List<HistoryG24> list =
|
||||||
|
historyG24Mapper.select(s->s
|
||||||
|
.orderBy(HistoryG24DynamicSqlSupport.addTime.descending())
|
||||||
|
.limit(p.getPageSize())
|
||||||
|
.offset(p.limitStart())
|
||||||
|
);
|
||||||
|
return R.SUCCESS(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.FALSE("无法找到该游戏数据");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Operation(summary = "test login")
|
||||||
|
// @PostMapping("/login")
|
||||||
|
// public Object login() {
|
||||||
|
//// Idc9998AdminInfo admin = idc9998Sevice.getByUserName("bk7897");
|
||||||
|
// hgt8Component.getInstance("bk7897").login();
|
||||||
|
//
|
||||||
|
// return R.FALSE("无法找到该游戏数据");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,139 @@
|
||||||
|
package jj.tech.paolu.biz.webadmin.controller;
|
||||||
|
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.count;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualToWhenPresent;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.select;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||||
|
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||||
|
import org.mybatis.dynamic.sql.select.QueryExpressionDSL;
|
||||||
|
import org.mybatis.dynamic.sql.select.SelectModel;
|
||||||
|
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||||
|
import org.mybatis.dynamic.sql.where.WhereApplier;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jj.tech.paolu.biz.webadmin.dao.SelectMapper;
|
||||||
|
import jj.tech.paolu.biz.webadmin.vo.Id;
|
||||||
|
import jj.tech.paolu.biz.webadmin.vo.Idc9998AdminAddVo;
|
||||||
|
import jj.tech.paolu.biz.webadmin.vo.Idc9998AdminListVo;
|
||||||
|
import jj.tech.paolu.biz.webadmin.vo.Idc9998AdminUpdateVo;
|
||||||
|
import jj.tech.paolu.repository.mybatis.dao.Idc9998AdminInfoMapper;
|
||||||
|
import jj.tech.paolu.repository.mybatis.dao.support.Idc9998AdminInfoDynamicSqlSupport;
|
||||||
|
import jj.tech.paolu.repository.mybatis.entity.Idc9998AdminInfo;
|
||||||
|
import jj.tech.paolu.utils.IDHelp;
|
||||||
|
import jj.tech.paolu.utils.Page;
|
||||||
|
import jj.tech.paolu.utils.R;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/op/idc9998/admin",name = "账号管理,代采账号列表")
|
||||||
|
@Tag(name = "Idc9998ProxyAccountContronller", description = "账号管理,代采账号列表")
|
||||||
|
public class Idc9998ProxyAccountContronller {
|
||||||
|
|
||||||
|
@Autowired SelectMapper selectMapper;
|
||||||
|
@Autowired Idc9998AdminInfoMapper idc9998AdminInfoMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "用于采集的账号列表")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Object list(@Validated @RequestBody Idc9998AdminListVo parame) {
|
||||||
|
|
||||||
|
Page p = new Page(parame.pageNum, parame.pageSize);
|
||||||
|
|
||||||
|
Function<QueryExpressionDSL.FromGatherer<SelectModel>, QueryExpressionDSL<SelectModel>> function =
|
||||||
|
s -> {
|
||||||
|
var from = s
|
||||||
|
.from(Idc9998AdminInfoDynamicSqlSupport.idc9998AdminInfo)
|
||||||
|
;
|
||||||
|
return from;
|
||||||
|
};
|
||||||
|
|
||||||
|
var where = SqlBuilder.where();
|
||||||
|
where.and(Idc9998AdminInfoDynamicSqlSupport.manager_name, isEqualToWhenPresent(parame.manager_name));
|
||||||
|
where.and(Idc9998AdminInfoDynamicSqlSupport.member_name, isEqualToWhenPresent(parame.member_name));
|
||||||
|
where.and(Idc9998AdminInfoDynamicSqlSupport.user_name, isEqualToWhenPresent(parame.user_name));
|
||||||
|
where.and(Idc9998AdminInfoDynamicSqlSupport.user_password, isEqualToWhenPresent(parame.user_password));
|
||||||
|
where.and(Idc9998AdminInfoDynamicSqlSupport.domain, isEqualToWhenPresent(parame.domain));
|
||||||
|
|
||||||
|
WhereApplier applier = where.toWhereApplier();
|
||||||
|
|
||||||
|
SelectStatementProvider provider = function.apply(select(Idc9998AdminInfoMapper.selectList))
|
||||||
|
.applyWhere(applier)
|
||||||
|
.configureStatement(config -> config.setNonRenderingWhereClauseAllowed(true))
|
||||||
|
.groupBy(Idc9998AdminInfoDynamicSqlSupport.id)
|
||||||
|
.orderBy(Idc9998AdminInfoDynamicSqlSupport.id.descending())
|
||||||
|
.limit(p.getPageSize())
|
||||||
|
.offset(p.limitStart())
|
||||||
|
.build()
|
||||||
|
.render(RenderingStrategies.MYBATIS3);
|
||||||
|
|
||||||
|
|
||||||
|
SelectStatementProvider count = select(count())
|
||||||
|
.from(function.apply(select(Idc9998AdminInfoMapper.selectList))
|
||||||
|
.applyWhere(applier)
|
||||||
|
.groupBy(Idc9998AdminInfoDynamicSqlSupport.id)
|
||||||
|
.orderBy(Idc9998AdminInfoDynamicSqlSupport.id.descending()),
|
||||||
|
"t1")
|
||||||
|
.configureStatement(config -> config.setNonRenderingWhereClauseAllowed(true))
|
||||||
|
.build()
|
||||||
|
.render(RenderingStrategies.MYBATIS3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var list = selectMapper.selectMany(provider);
|
||||||
|
long total = selectMapper.count(count);
|
||||||
|
p.setList(list);
|
||||||
|
p.setTotal(total);
|
||||||
|
return R.SUCCESS(p);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "新增代采账号")
|
||||||
|
@PostMapping("/add")
|
||||||
|
public Object add(@Validated @RequestBody Idc9998AdminAddVo parame) {
|
||||||
|
|
||||||
|
Idc9998AdminInfo bean = new Idc9998AdminInfo();
|
||||||
|
BeanUtils.copyProperties(parame, bean);
|
||||||
|
bean.setId(IDHelp.getInstance().nextId());
|
||||||
|
|
||||||
|
idc9998AdminInfoMapper.insertSelective(bean);
|
||||||
|
|
||||||
|
return R.SUCCESS(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "", description = "")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public Object update(@Validated @RequestBody Idc9998AdminUpdateVo parame) {
|
||||||
|
Idc9998AdminInfo bean = new Idc9998AdminInfo();
|
||||||
|
BeanUtils.copyProperties(parame, bean);
|
||||||
|
idc9998AdminInfoMapper.updateByPrimaryKeySelective(bean);
|
||||||
|
return R.SUCCESS(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "", description = "")
|
||||||
|
@PostMapping("/get")
|
||||||
|
public Object get(@Validated @RequestBody Id parame) {
|
||||||
|
Idc9998AdminInfo bean =
|
||||||
|
idc9998AdminInfoMapper.selectByPrimaryKey(parame.id).orElse(null);
|
||||||
|
return R.SUCCESS(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "", description = "")
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public Object delete(@Validated @RequestBody Id parame) {
|
||||||
|
idc9998AdminInfoMapper.deleteByPrimaryKey(parame.id);
|
||||||
|
return R.SUCCESS("ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package jj.tech.paolu.biz.webadmin.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/op/idc9998/admin",name = "会员账号列表(未开发)")
|
||||||
|
@Tag(name = "Idc9998ProxyMemberContronller", description = "会员账号列表(未开发)")
|
||||||
|
public class Idc9998ProxyMemberContronller {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package jj.tech.paolu.biz.webadmin.controller;
|
package jj.tech.paolu.biz.webadmin.controller;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
@ -9,12 +7,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jj.tech.paolu.biz.webadmin.vo.YmCodeVo;
|
import jj.tech.paolu.biz.webadmin.vo.YmCodeVo;
|
||||||
import jj.tech.paolu.utils.R;
|
import jj.tech.paolu.utils.R;
|
||||||
import jj.tech.paolu.utils.YMHttp;
|
import jj.tech.paolu.utils.YMHttp;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "/op/ym",name = "云码图片识别接口")
|
@RequestMapping(value = "/op/ym",name = "云码图片识别接口")
|
||||||
|
@Tag(name = "YMcodeController", description = "云码图片识别接口")
|
||||||
public class YMcodeController {
|
public class YMcodeController {
|
||||||
|
|
||||||
@Operation(summary = "需要识别图片的base64字符串", description = "image_base64")
|
@Operation(summary = "需要识别图片的base64字符串", description = "image_base64")
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package jj.tech.paolu.config.enums;
|
package jj.tech.paolu.config.enums;
|
||||||
|
|
||||||
public enum Games {
|
public enum Games {
|
||||||
G_21("G_21","幸运飞艇"),
|
G_24("G_24","幸运飞艇"),
|
||||||
G_29("G_29", "极速时时彩"),
|
G_29("G_29", "极速时时彩"),
|
||||||
G_30("G_30", "极速赛车"),
|
G_30("G_30", "极速赛车"),
|
||||||
G_31("G_31", "极速飞艇"),
|
G_31("G_31", "极速飞艇"),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package test.nw;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
public class FutureTest {
|
||||||
|
|
||||||
|
static AtomicInteger erro = new AtomicInteger(0);
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String result = call("aaa")
|
||||||
|
.join();
|
||||||
|
System.out.println(result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CompletableFuture<String> call(String user) {
|
||||||
|
|
||||||
|
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
|
||||||
|
int i= 1/0;
|
||||||
|
return "resl";
|
||||||
|
});
|
||||||
|
|
||||||
|
return future.handleAsync((String result, Throwable ex) -> {
|
||||||
|
// or any other Predicate that is satisfied against ex
|
||||||
|
if(ex != null) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
System.out.println(erro.get());
|
||||||
|
erro.getAndIncrement();
|
||||||
|
return call(user);
|
||||||
|
} else {
|
||||||
|
return future;
|
||||||
|
}
|
||||||
|
}).thenCompose(Function.identity());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user