4 changed files with 405 additions and 0 deletions
@ -0,0 +1,348 @@ |
|||||
|
package bc.mm.mis.core.bean; |
||||
|
|
||||
|
import javax.persistence.Column; |
||||
|
import javax.persistence.Id; |
||||
|
import java.math.BigInteger; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class Coins { |
||||
|
@Id |
||||
|
@Column(name = "coin_id") |
||||
|
private Integer coinId; |
||||
|
|
||||
|
@Column(name = "coin_name") |
||||
|
private String coinName; |
||||
|
|
||||
|
private String symbol; |
||||
|
|
||||
|
@Column(name = "qty_decimals") |
||||
|
private Integer qtyDecimals; |
||||
|
|
||||
|
@Column(name = "price_decimals") |
||||
|
private Integer priceDecimals; |
||||
|
|
||||
|
@Column(name = "full_name") |
||||
|
private String fullName; |
||||
|
private String trc20; |
||||
|
|
||||
|
@Column(name = "withdrawal_fee") |
||||
|
private String withdrawalFee; |
||||
|
|
||||
|
@Column(name = "withdrawal_min") |
||||
|
private String withdrawalMin; |
||||
|
|
||||
|
@Column(name = "withdrawal_max") |
||||
|
private String withdrawalMax; |
||||
|
|
||||
|
@Column(name = "coin_withdraw_message") |
||||
|
private String coinWithrawMessage; |
||||
|
|
||||
|
@Column(name = "coin_recharge_message") |
||||
|
private String coinRechargeMessage; |
||||
|
|
||||
|
@Column(name = "coin_transfer_message") |
||||
|
private String coinTransferMessage; |
||||
|
|
||||
|
@Column(name = "coin_content") |
||||
|
private String coinContent; |
||||
|
|
||||
|
@Column(name = "coin_icon") |
||||
|
private String coinIcon; |
||||
|
private Integer status; |
||||
|
private String appKey; |
||||
|
private String appSecret; |
||||
|
|
||||
|
@Column(name = "official_website_link") |
||||
|
private String officialWebsiteLink; |
||||
|
|
||||
|
@Column(name = "white_paper_link") |
||||
|
private String whitePaperLink; |
||||
|
|
||||
|
@Column(name = "block_query_link") |
||||
|
private String blockQueryLink; |
||||
|
|
||||
|
@Column(name = "public_time") |
||||
|
private Date pulishTime; |
||||
|
|
||||
|
@Column(name = "total_issuance") |
||||
|
private BigInteger totalIssuance; |
||||
|
|
||||
|
@Column(name = "total_circulation") |
||||
|
private BigInteger totalCirculation; |
||||
|
|
||||
|
@Column(name = "crowdfunding_price") |
||||
|
private String crowdfundingPrice; |
||||
|
private Integer order; |
||||
|
|
||||
|
@Column(name = "is_withdraw") |
||||
|
private Integer isWithdraw; |
||||
|
|
||||
|
@Column(name = "is_recharge") |
||||
|
private Integer isRecharge; |
||||
|
|
||||
|
@Column(name = "can_recharge") |
||||
|
private Integer canRecharge; |
||||
|
|
||||
|
@Column(name = "created_at") |
||||
|
private Date createdAt; |
||||
|
|
||||
|
@Column(name = "updated_at") |
||||
|
private Date updatedAt; |
||||
|
private Integer sort; |
||||
|
|
||||
|
public Integer getCoinId() { |
||||
|
return coinId; |
||||
|
} |
||||
|
|
||||
|
public void setCoinId(Integer coinId) { |
||||
|
this.coinId = coinId; |
||||
|
} |
||||
|
|
||||
|
public String getCoinName() { |
||||
|
return coinName; |
||||
|
} |
||||
|
|
||||
|
public void setCoinName(String coinName) { |
||||
|
this.coinName = coinName; |
||||
|
} |
||||
|
|
||||
|
public String getSymbol() { |
||||
|
return symbol; |
||||
|
} |
||||
|
|
||||
|
public void setSymbol(String symbol) { |
||||
|
this.symbol = symbol; |
||||
|
} |
||||
|
|
||||
|
public Integer getQtyDecimals() { |
||||
|
return qtyDecimals; |
||||
|
} |
||||
|
|
||||
|
public void setQtyDecimals(Integer qtyDecimals) { |
||||
|
this.qtyDecimals = qtyDecimals; |
||||
|
} |
||||
|
|
||||
|
public Integer getPriceDecimals() { |
||||
|
return priceDecimals; |
||||
|
} |
||||
|
|
||||
|
public void setPriceDecimals(Integer priceDecimals) { |
||||
|
this.priceDecimals = priceDecimals; |
||||
|
} |
||||
|
|
||||
|
public String getFullName() { |
||||
|
return fullName; |
||||
|
} |
||||
|
|
||||
|
public void setFullName(String fullName) { |
||||
|
this.fullName = fullName; |
||||
|
} |
||||
|
|
||||
|
public String getTrc20() { |
||||
|
return trc20; |
||||
|
} |
||||
|
|
||||
|
public void setTrc20(String trc20) { |
||||
|
this.trc20 = trc20; |
||||
|
} |
||||
|
|
||||
|
public String getWithdrawalFee() { |
||||
|
return withdrawalFee; |
||||
|
} |
||||
|
|
||||
|
public void setWithdrawalFee(String withdrawalFee) { |
||||
|
this.withdrawalFee = withdrawalFee; |
||||
|
} |
||||
|
|
||||
|
public String getWithdrawalMin() { |
||||
|
return withdrawalMin; |
||||
|
} |
||||
|
|
||||
|
public void setWithdrawalMin(String withdrawalMin) { |
||||
|
this.withdrawalMin = withdrawalMin; |
||||
|
} |
||||
|
|
||||
|
public String getWithdrawalMax() { |
||||
|
return withdrawalMax; |
||||
|
} |
||||
|
|
||||
|
public void setWithdrawalMax(String withdrawalMax) { |
||||
|
this.withdrawalMax = withdrawalMax; |
||||
|
} |
||||
|
|
||||
|
public String getCoinWithrawMessage() { |
||||
|
return coinWithrawMessage; |
||||
|
} |
||||
|
|
||||
|
public void setCoinWithrawMessage(String coinWithrawMessage) { |
||||
|
this.coinWithrawMessage = coinWithrawMessage; |
||||
|
} |
||||
|
|
||||
|
public String getCoinRechargeMessage() { |
||||
|
return coinRechargeMessage; |
||||
|
} |
||||
|
|
||||
|
public void setCoinRechargeMessage(String coinRechargeMessage) { |
||||
|
this.coinRechargeMessage = coinRechargeMessage; |
||||
|
} |
||||
|
|
||||
|
public String getCoinTransferMessage() { |
||||
|
return coinTransferMessage; |
||||
|
} |
||||
|
|
||||
|
public void setCoinTransferMessage(String coinTransferMessage) { |
||||
|
this.coinTransferMessage = coinTransferMessage; |
||||
|
} |
||||
|
|
||||
|
public String getCoinContent() { |
||||
|
return coinContent; |
||||
|
} |
||||
|
|
||||
|
public void setCoinContent(String coinContent) { |
||||
|
this.coinContent = coinContent; |
||||
|
} |
||||
|
|
||||
|
public String getCoinIcon() { |
||||
|
return coinIcon; |
||||
|
} |
||||
|
|
||||
|
public void setCoinIcon(String coinIcon) { |
||||
|
this.coinIcon = coinIcon; |
||||
|
} |
||||
|
|
||||
|
public Integer getStatus() { |
||||
|
return status; |
||||
|
} |
||||
|
|
||||
|
public void setStatus(Integer status) { |
||||
|
this.status = status; |
||||
|
} |
||||
|
|
||||
|
public String getAppKey() { |
||||
|
return appKey; |
||||
|
} |
||||
|
|
||||
|
public void setAppKey(String appKey) { |
||||
|
this.appKey = appKey; |
||||
|
} |
||||
|
|
||||
|
public String getAppSecret() { |
||||
|
return appSecret; |
||||
|
} |
||||
|
|
||||
|
public void setAppSecret(String appSecret) { |
||||
|
this.appSecret = appSecret; |
||||
|
} |
||||
|
|
||||
|
public String getOfficialWebsiteLink() { |
||||
|
return officialWebsiteLink; |
||||
|
} |
||||
|
|
||||
|
public void setOfficialWebsiteLink(String officialWebsiteLink) { |
||||
|
this.officialWebsiteLink = officialWebsiteLink; |
||||
|
} |
||||
|
|
||||
|
public String getWhitePaperLink() { |
||||
|
return whitePaperLink; |
||||
|
} |
||||
|
|
||||
|
public void setWhitePaperLink(String whitePaperLink) { |
||||
|
this.whitePaperLink = whitePaperLink; |
||||
|
} |
||||
|
|
||||
|
public String getBlockQueryLink() { |
||||
|
return blockQueryLink; |
||||
|
} |
||||
|
|
||||
|
public void setBlockQueryLink(String blockQueryLink) { |
||||
|
this.blockQueryLink = blockQueryLink; |
||||
|
} |
||||
|
|
||||
|
public Date getPulishTime() { |
||||
|
return pulishTime; |
||||
|
} |
||||
|
|
||||
|
public void setPulishTime(Date pulishTime) { |
||||
|
this.pulishTime = pulishTime; |
||||
|
} |
||||
|
|
||||
|
public BigInteger getTotalIssuance() { |
||||
|
return totalIssuance; |
||||
|
} |
||||
|
|
||||
|
public void setTotalIssuance(BigInteger totalIssuance) { |
||||
|
this.totalIssuance = totalIssuance; |
||||
|
} |
||||
|
|
||||
|
public BigInteger getTotalCirculation() { |
||||
|
return totalCirculation; |
||||
|
} |
||||
|
|
||||
|
public void setTotalCirculation(BigInteger totalCirculation) { |
||||
|
this.totalCirculation = totalCirculation; |
||||
|
} |
||||
|
|
||||
|
public String getCrowdfundingPrice() { |
||||
|
return crowdfundingPrice; |
||||
|
} |
||||
|
|
||||
|
public void setCrowdfundingPrice(String crowdfundingPrice) { |
||||
|
this.crowdfundingPrice = crowdfundingPrice; |
||||
|
} |
||||
|
|
||||
|
public Integer getOrder() { |
||||
|
return order; |
||||
|
} |
||||
|
|
||||
|
public void setOrder(Integer order) { |
||||
|
this.order = order; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsWithdraw() { |
||||
|
return isWithdraw; |
||||
|
} |
||||
|
|
||||
|
public void setIsWithdraw(Integer isWithdraw) { |
||||
|
this.isWithdraw = isWithdraw; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsRecharge() { |
||||
|
return isRecharge; |
||||
|
} |
||||
|
|
||||
|
public void setIsRecharge(Integer isRecharge) { |
||||
|
this.isRecharge = isRecharge; |
||||
|
} |
||||
|
|
||||
|
public Integer getCanRecharge() { |
||||
|
return canRecharge; |
||||
|
} |
||||
|
|
||||
|
public void setCanRecharge(Integer canRecharge) { |
||||
|
this.canRecharge = canRecharge; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Integer getSort() { |
||||
|
return sort; |
||||
|
} |
||||
|
|
||||
|
public void setSort(Integer sort) { |
||||
|
this.sort = sort; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package bc.mm.mis.core.dao; |
||||
|
|
||||
|
import bc.mm.mis.core.bean.Coins; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.data.domain.Pageable; |
||||
|
import org.springframework.data.jpa.repository.JpaRepository; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
|
||||
|
@Repository |
||||
|
public interface CoinsDao extends JpaRepository<Coins,Integer> { |
||||
|
/** |
||||
|
* 分页查询 |
||||
|
* @param pageable |
||||
|
* @return |
||||
|
*/ |
||||
|
Page<Coins> findAll(Pageable pageable); |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
package bc.mm.mis.core.service; |
||||
|
|
||||
|
import bc.mm.mis.core.bean.Coins; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface CoinsService { |
||||
|
/** |
||||
|
* pagingnation |
||||
|
* @param page |
||||
|
* @param size |
||||
|
* @return |
||||
|
*/ |
||||
|
List<Coins> getCoinsList(int page, int size); |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package bc.mm.mis.core.service.impl; |
||||
|
|
||||
|
import bc.mm.mis.core.bean.Coins; |
||||
|
import bc.mm.mis.core.dao.CoinsDao; |
||||
|
import bc.mm.mis.core.service.CoinsService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.data.domain.PageRequest; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class CoinsServiceImpl implements CoinsService { |
||||
|
@Autowired |
||||
|
private CoinsDao coinsDao; |
||||
|
|
||||
|
@Override |
||||
|
public List<Coins> getCoinsList(int page, int size) { |
||||
|
PageRequest pageRequest = PageRequest.of(page,size); |
||||
|
Page<Coins> coinsPage = coinsDao.findAll(pageRequest); |
||||
|
return coinsPage.getContent(); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue