parent
a19770bfab
commit
6f0de2a319
@ -0,0 +1,137 @@
|
||||
package com.mashibing.test.entity;
|
||||
|
||||
|
||||
public class MobileBlack {
|
||||
|
||||
private long id;
|
||||
private String blackNumber;
|
||||
private long blackType;
|
||||
private long clientId;
|
||||
private java.sql.Timestamp created;
|
||||
private long createId;
|
||||
private java.sql.Timestamp updated;
|
||||
private long updateId;
|
||||
private long isDelete;
|
||||
private String extend1;
|
||||
private String extend2;
|
||||
private String extend3;
|
||||
private String extend4;
|
||||
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getBlackNumber() {
|
||||
return blackNumber;
|
||||
}
|
||||
|
||||
public void setBlackNumber(String blackNumber) {
|
||||
this.blackNumber = blackNumber;
|
||||
}
|
||||
|
||||
|
||||
public long getBlackType() {
|
||||
return blackType;
|
||||
}
|
||||
|
||||
public void setBlackType(long blackType) {
|
||||
this.blackType = blackType;
|
||||
}
|
||||
|
||||
|
||||
public long getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(long clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
|
||||
public java.sql.Timestamp getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(java.sql.Timestamp created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
|
||||
public long getCreateId() {
|
||||
return createId;
|
||||
}
|
||||
|
||||
public void setCreateId(long createId) {
|
||||
this.createId = createId;
|
||||
}
|
||||
|
||||
|
||||
public java.sql.Timestamp getUpdated() {
|
||||
return updated;
|
||||
}
|
||||
|
||||
public void setUpdated(java.sql.Timestamp updated) {
|
||||
this.updated = updated;
|
||||
}
|
||||
|
||||
|
||||
public long getUpdateId() {
|
||||
return updateId;
|
||||
}
|
||||
|
||||
public void setUpdateId(long updateId) {
|
||||
this.updateId = updateId;
|
||||
}
|
||||
|
||||
|
||||
public long getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(long isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend1() {
|
||||
return extend1;
|
||||
}
|
||||
|
||||
public void setExtend1(String extend1) {
|
||||
this.extend1 = extend1;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend2() {
|
||||
return extend2;
|
||||
}
|
||||
|
||||
public void setExtend2(String extend2) {
|
||||
this.extend2 = extend2;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend3() {
|
||||
return extend3;
|
||||
}
|
||||
|
||||
public void setExtend3(String extend3) {
|
||||
this.extend3 = extend3;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend4() {
|
||||
return extend4;
|
||||
}
|
||||
|
||||
public void setExtend4(String extend4) {
|
||||
this.extend4 = extend4;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.mashibing.test.mapper;
|
||||
|
||||
import com.mashibing.test.entity.MobileBlack;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author heqijun
|
||||
* @ClassName: MobileBlackMapper
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @date 2025/6/10 17:00
|
||||
*/
|
||||
|
||||
public interface MobileBlackMapper {
|
||||
|
||||
@Select("select black_number,client_id from mobile_black where is_delete = 0")
|
||||
List<MobileBlack> findAll1();
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.mashibing.test.mapper;
|
||||
|
||||
import com.mashibing.test.entity.MobileBlack;
|
||||
import com.mashibing.test.feignClient.CacheClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@SpringBootTest
|
||||
@RunWith(SpringRunner.class)
|
||||
class MobileBlackMapperTest {
|
||||
@Autowired
|
||||
CacheClient cacheClient;
|
||||
|
||||
@Autowired
|
||||
MobileBlackMapper mapper;
|
||||
|
||||
@Test
|
||||
void findAll1() {
|
||||
List<MobileBlack> mobileBlackList = mapper.findAll1();
|
||||
for (MobileBlack mobileBlack : mobileBlackList) {
|
||||
if (mobileBlack.getClientId() == 0) {
|
||||
//平台级
|
||||
cacheClient.set("black:" + mobileBlack.getBlackNumber(), "1");
|
||||
}else {
|
||||
cacheClient.set("black:" +mobileBlack.getClientId()+":"+ mobileBlack.getBlackNumber(), "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue