type of data is changed
This commit is contained in:
parent
6b9b7e6b24
commit
30555e9773
|
@ -1,7 +1,7 @@
|
||||||
CREATE TABLE IF NOT EXISTS api_kgon_synchronizations (
|
CREATE TABLE IF NOT EXISTS api_kgon_synchronizations (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
item TEXT NOT NULL,
|
item TEXT NOT NULL,
|
||||||
last_code BIGINT NOT NULL,
|
last_code INTEGER NOT NULL,
|
||||||
synchronized_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000)
|
synchronized_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS api_kgon_synchronization_history (
|
||||||
item TEXT NOT NULL,
|
item TEXT NOT NULL,
|
||||||
start_at BIGINT NOT NULL,
|
start_at BIGINT NOT NULL,
|
||||||
complete_at BIGINT NOT NULL,
|
complete_at BIGINT NOT NULL,
|
||||||
code BIGINT NOT NULL,
|
code INTEGER NOT NULL,
|
||||||
message TEXT,
|
message TEXT,
|
||||||
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000)
|
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000)
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
CREATE TABLE IF NOT EXISTS api_kgon_members (
|
CREATE TABLE IF NOT EXISTS api_kgon_members (
|
||||||
id BIGINT NOT NULL,
|
id INTEGER NOT NULL,
|
||||||
balance BIGINT NOT NULL DEFAULT 0,
|
balance INTEGER NOT NULL DEFAULT 0,
|
||||||
balance_bota BIGINT NOT NULL DEFAULT 0,
|
balance_bota INTEGER NOT NULL DEFAULT 0,
|
||||||
balance_sum BIGINT NOT NULL DEFAULT 0,
|
balance_sum INTEGER NOT NULL DEFAULT 0,
|
||||||
companies BIGINT NOT NULL DEFAULT 0,
|
companies INTEGER NOT NULL DEFAULT 0,
|
||||||
oriental_play BOOLEAN NOT NULL DEFAULT FALSE,
|
oriental_play BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
member_id UUID NOT NULL,
|
member_id UUID NOT NULL,
|
||||||
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
CREATE TABLE IF NOT EXISTS api_kgon_balances (
|
CREATE TABLE IF NOT EXISTS api_kgon_balances (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
balance BIGINT NOT NULL DEFAULT 0,
|
balance INTEGER NOT NULL DEFAULT 0,
|
||||||
balance_bota BIGINT NOT NULL DEFAULT 0,
|
balance_bota INTEGER NOT NULL DEFAULT 0,
|
||||||
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
||||||
updated_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000)
|
updated_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000)
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
CREATE TABLE IF NOT EXISTS api_kgon_vendors (
|
CREATE TABLE IF NOT EXISTS api_kgon_vendors (
|
||||||
id BIGINT NOT NULL,
|
id INTEGER NOT NULL,
|
||||||
company_id BIGINT NOT NULL,
|
company_id INTEGER NOT NULL,
|
||||||
vendor_id BIGINT NOT NULL,
|
vendor_id INTEGER NOT NULL,
|
||||||
max_bet_casino BIGINT NOT NULL,
|
max_bet_casino INTEGER NOT NULL,
|
||||||
max_bet_slot BIGINT NOT NULL,
|
max_bet_slot INTEGER NOT NULL,
|
||||||
is_enable CHAR(1) NOT NULL,
|
is_enable CHAR(1) NOT NULL,
|
||||||
bet_count BIGINT NOT NULL,
|
bet_count INTEGER NOT NULL,
|
||||||
key TEXT NOT NULL,
|
key TEXT NOT NULL,
|
||||||
name TEXT NOT NULL,
|
name TEXT NOT NULL,
|
||||||
category TEXT NOT NULL,
|
category TEXT NOT NULL,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
CREATE TABLE IF NOT EXISTS api_kgon_games (
|
CREATE TABLE IF NOT EXISTS api_kgon_games (
|
||||||
id BIGINT NOT NULL,
|
id INTEGER NOT NULL,
|
||||||
vendor_id BIGINT NOT NULL,
|
vendor_id INTEGER NOT NULL,
|
||||||
key TEXT NOT NULL,
|
key TEXT NOT NULL,
|
||||||
names TEXT NOT NULL,
|
names TEXT NOT NULL,
|
||||||
platform TEXT NOT NULL,
|
platform TEXT NOT NULL,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@ pub struct FindTransactionsRequest {
|
||||||
pub edate: Option<String>,
|
pub edate: Option<String>,
|
||||||
pub group_key: Option<String>,
|
pub group_key: Option<String>,
|
||||||
pub username: Option<String>,
|
pub username: Option<String>,
|
||||||
pub limit: i64,
|
pub limit: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct FindTransactionsResponse {
|
pub struct FindTransactionsResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub transactions: Vec<String>,
|
pub transactions: Vec<String>,
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ pub struct FindPragmaticHistoryRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct FindPragmaticHistoryResponse {
|
pub struct FindPragmaticHistoryResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub url: Option<String>,
|
pub url: Option<String>,
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ pub struct FindEvolutionTransactionDetailRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct FindEvolutionTransactionDetailResponse {
|
pub struct FindEvolutionTransactionDetailResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub transactions: Vec<String>,
|
pub transactions: Vec<String>,
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ pub struct FindStatisticRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct FindStatisticResponse {
|
pub struct FindStatisticResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub data: Option<String>,
|
pub data: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::collections::HashMap;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct Game {
|
pub struct Game {
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
pub key: String,
|
pub key: String,
|
||||||
pub names: HashMap<String, String>,
|
pub names: HashMap<String, String>,
|
||||||
pub platform: String,
|
pub platform: String,
|
||||||
|
@ -19,7 +19,7 @@ pub struct ListGamesRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct _ListGamesResponse {
|
pub struct _ListGamesResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub games: Vec<Game>,
|
pub games: Vec<Game>,
|
||||||
}
|
}
|
||||||
|
@ -36,23 +36,23 @@ pub struct PlayRequest {
|
||||||
pub nickname: String,
|
pub nickname: String,
|
||||||
pub site_username: String,
|
pub site_username: String,
|
||||||
pub group_key: Option<String>,
|
pub group_key: Option<String>,
|
||||||
pub amount: i64,
|
pub amount: i32,
|
||||||
pub request_key: Option<String>,
|
pub request_key: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct _PlayResponse {
|
pub struct _PlayResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
#[serde(rename = "userId")]
|
#[serde(rename = "userId")]
|
||||||
pub user_id: String,
|
pub user_id: String,
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PlayResponse {
|
pub struct PlayResponse {
|
||||||
pub user_id: String,
|
pub user_id: String,
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,10 @@ pub struct ListMembersRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct Member {
|
pub struct Member {
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub cash: i64,
|
pub cash: i32,
|
||||||
pub cash_bota: i64,
|
pub cash_bota: i32,
|
||||||
pub nickname: String,
|
pub nickname: String,
|
||||||
pub site_username: String,
|
pub site_username: String,
|
||||||
pub group_key: Option<String>,
|
pub group_key: Option<String>,
|
||||||
|
@ -19,7 +19,7 @@ pub struct Member {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct _ListMembersResponse {
|
pub struct _ListMembersResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub users: Vec<Member>,
|
pub users: Vec<Member>,
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ pub struct SaveMemberRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct SaveMemberResponse {
|
pub struct SaveMemberResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub id: Option<i64>,
|
pub id: Option<i32>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,50 +6,50 @@ pub struct GetBalanceForUserRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct _GetBalanceForUserResponse {
|
pub struct _GetBalanceForUserResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
pub balance_sum: i64,
|
pub balance_sum: i32,
|
||||||
pub companies: i64,
|
pub companies: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct GetBalanceForUserResponse {
|
pub struct GetBalanceForUserResponse {
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
pub balance_sum: i64,
|
pub balance_sum: i32,
|
||||||
pub companies: i64,
|
pub companies: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct GetBalanceForPartnerRequest {}
|
pub struct GetBalanceForPartnerRequest {}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct _GetBalanceForPartnerResponse {
|
pub struct _GetBalanceForPartnerResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct GetBalanceForPartnerResponse {
|
pub struct GetBalanceForPartnerResponse {
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SaveDepositRequest {
|
pub struct SaveDepositRequest {
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub cash_type: Option<String>,
|
pub cash_type: Option<String>,
|
||||||
pub amount: i64,
|
pub amount: i32,
|
||||||
pub request_key: Option<String>,
|
pub request_key: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct SaveDepositResponse {
|
pub struct SaveDepositResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SaveWithdrawRequest {
|
pub struct SaveWithdrawRequest {
|
||||||
|
@ -59,10 +59,10 @@ pub struct SaveWithdrawRequest {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct SaveWithdrawResponse {
|
pub struct SaveWithdrawResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
pub balance_cash: i64,
|
pub balance_cash: i32,
|
||||||
pub balance_cash_bota: i64,
|
pub balance_cash_bota: i32,
|
||||||
pub amount: i64,
|
pub amount: i32,
|
||||||
}
|
}
|
||||||
|
|
14
src/api/vendor/models.rs
vendored
14
src/api/vendor/models.rs
vendored
|
@ -2,13 +2,13 @@ use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct Vendor {
|
pub struct Vendor {
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
pub company_id: i64,
|
pub company_id: i32,
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
pub max_bet_casino: i64,
|
pub max_bet_casino: i32,
|
||||||
pub max_bet_slot: i64,
|
pub max_bet_slot: i32,
|
||||||
pub is_enable: String,
|
pub is_enable: String,
|
||||||
pub bet_count: i64,
|
pub bet_count: i32,
|
||||||
pub key: String,
|
pub key: String,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub category: String,
|
pub category: String,
|
||||||
|
@ -18,7 +18,7 @@ pub struct ListVendorsRequest {}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct _ListVendorsResponse {
|
pub struct _ListVendorsResponse {
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
pub msg: Option<String>,
|
pub msg: Option<String>,
|
||||||
pub vendors: Vec<Vendor>,
|
pub vendors: Vec<Vendor>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,9 @@ pub struct Balance {
|
||||||
///
|
///
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
///
|
///
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
///
|
///
|
||||||
pub created_at: i64,
|
pub created_at: i64,
|
||||||
///
|
///
|
||||||
|
@ -21,9 +21,9 @@ pub struct Balance {
|
||||||
#[table_name = "api_kgon_balances"]
|
#[table_name = "api_kgon_balances"]
|
||||||
pub struct NewBalance {
|
pub struct NewBalance {
|
||||||
///
|
///
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
///
|
///
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -31,7 +31,7 @@ pub struct NewBalance {
|
||||||
#[table_name = "api_kgon_balances"]
|
#[table_name = "api_kgon_balances"]
|
||||||
pub struct ModifyBalance {
|
pub struct ModifyBalance {
|
||||||
///
|
///
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
///
|
///
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,9 @@ table! {
|
||||||
///
|
///
|
||||||
id -> Integer,
|
id -> Integer,
|
||||||
///
|
///
|
||||||
balance -> BigInt,
|
balance -> Integer,
|
||||||
///
|
///
|
||||||
balance_bota -> BigInt,
|
balance_bota -> Integer,
|
||||||
///
|
///
|
||||||
created_at -> BigInt,
|
created_at -> BigInt,
|
||||||
///
|
///
|
||||||
|
|
|
@ -6,9 +6,9 @@ use beteran_common_rust as bcr;
|
||||||
#[table_name = "api_kgon_games"]
|
#[table_name = "api_kgon_games"]
|
||||||
pub struct Game {
|
pub struct Game {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
///
|
///
|
||||||
pub key: String,
|
pub key: String,
|
||||||
///
|
///
|
||||||
|
@ -32,9 +32,9 @@ pub struct Game {
|
||||||
#[table_name = "api_kgon_games"]
|
#[table_name = "api_kgon_games"]
|
||||||
pub struct NewGame {
|
pub struct NewGame {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
///
|
///
|
||||||
pub key: String,
|
pub key: String,
|
||||||
///
|
///
|
||||||
|
@ -72,9 +72,9 @@ pub struct ModifyGame {
|
||||||
#[table_name = "api_kgon_games"]
|
#[table_name = "api_kgon_games"]
|
||||||
pub struct UpsertGame {
|
pub struct UpsertGame {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
///
|
///
|
||||||
pub key: String,
|
pub key: String,
|
||||||
///
|
///
|
||||||
|
@ -93,7 +93,7 @@ pub struct UpsertGame {
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FindAllSearch {
|
pub struct FindAllSearch {
|
||||||
///
|
///
|
||||||
pub vendor_id: Option<i64>,
|
pub vendor_id: Option<i32>,
|
||||||
///
|
///
|
||||||
pub key_like: Option<String>,
|
pub key_like: Option<String>,
|
||||||
///
|
///
|
||||||
|
|
|
@ -70,7 +70,7 @@ impl Repository {
|
||||||
pub fn select(
|
pub fn select(
|
||||||
&self,
|
&self,
|
||||||
conn: &diesel::PgConnection,
|
conn: &diesel::PgConnection,
|
||||||
id: i64,
|
id: i32,
|
||||||
) -> Result<Option<models::Game>, Error> {
|
) -> Result<Option<models::Game>, Error> {
|
||||||
match api_kgon_games::table.find(id).first::<models::Game>(conn) {
|
match api_kgon_games::table.find(id).first::<models::Game>(conn) {
|
||||||
Ok(m) => Ok(Some(m)),
|
Ok(m) => Ok(Some(m)),
|
||||||
|
@ -206,7 +206,7 @@ impl Repository {
|
||||||
pub fn update(
|
pub fn update(
|
||||||
&self,
|
&self,
|
||||||
conn: &diesel::PgConnection,
|
conn: &diesel::PgConnection,
|
||||||
id: i64,
|
id: i32,
|
||||||
modify: &models::ModifyGame,
|
modify: &models::ModifyGame,
|
||||||
) -> Result<u64, Error> {
|
) -> Result<u64, Error> {
|
||||||
use api_kgon_games::dsl;
|
use api_kgon_games::dsl;
|
||||||
|
@ -218,7 +218,7 @@ impl Repository {
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
pub fn delete(&self, conn: &diesel::PgConnection, id: i64) -> Result<u64, Error> {
|
pub fn delete(&self, conn: &diesel::PgConnection, id: i32) -> Result<u64, Error> {
|
||||||
use api_kgon_games::dsl;
|
use api_kgon_games::dsl;
|
||||||
|
|
||||||
diesel::delete(api_kgon_games::table.filter(dsl::id.eq(id)))
|
diesel::delete(api_kgon_games::table.filter(dsl::id.eq(id)))
|
||||||
|
|
|
@ -5,9 +5,9 @@ table! {
|
||||||
///
|
///
|
||||||
api_kgon_games(id) {
|
api_kgon_games(id) {
|
||||||
///
|
///
|
||||||
id -> BigInt,
|
id -> Integer,
|
||||||
///
|
///
|
||||||
vendor_id -> BigInt,
|
vendor_id -> Integer,
|
||||||
///
|
///
|
||||||
key -> Text,
|
key -> Text,
|
||||||
///
|
///
|
||||||
|
|
|
@ -6,15 +6,15 @@ use beteran_common_rust as bcr;
|
||||||
#[table_name = "api_kgon_members"]
|
#[table_name = "api_kgon_members"]
|
||||||
pub struct Member {
|
pub struct Member {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
///
|
///
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
///
|
///
|
||||||
pub balance_sum: i64,
|
pub balance_sum: i32,
|
||||||
///
|
///
|
||||||
pub companies: i64,
|
pub companies: i32,
|
||||||
///
|
///
|
||||||
pub oriental_play: String,
|
pub oriental_play: String,
|
||||||
///
|
///
|
||||||
|
@ -30,15 +30,15 @@ pub struct Member {
|
||||||
#[table_name = "api_kgon_members"]
|
#[table_name = "api_kgon_members"]
|
||||||
pub struct NewMember {
|
pub struct NewMember {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
///
|
///
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
///
|
///
|
||||||
pub balance_sum: i64,
|
pub balance_sum: i32,
|
||||||
///
|
///
|
||||||
pub companies: i64,
|
pub companies: i32,
|
||||||
///
|
///
|
||||||
pub oriental_play: String,
|
pub oriental_play: String,
|
||||||
///
|
///
|
||||||
|
@ -50,9 +50,9 @@ pub struct NewMember {
|
||||||
#[table_name = "api_kgon_members"]
|
#[table_name = "api_kgon_members"]
|
||||||
pub struct ModifyMember {
|
pub struct ModifyMember {
|
||||||
///
|
///
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
///
|
///
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
///
|
///
|
||||||
pub oriental_play: String,
|
pub oriental_play: String,
|
||||||
}
|
}
|
||||||
|
@ -62,13 +62,13 @@ pub struct ModifyMember {
|
||||||
#[table_name = "api_kgon_members"]
|
#[table_name = "api_kgon_members"]
|
||||||
pub struct ModifyMemberForBalance {
|
pub struct ModifyMemberForBalance {
|
||||||
///
|
///
|
||||||
pub balance: i64,
|
pub balance: i32,
|
||||||
///
|
///
|
||||||
pub balance_bota: i64,
|
pub balance_bota: i32,
|
||||||
///
|
///
|
||||||
pub balance_sum: i64,
|
pub balance_sum: i32,
|
||||||
///
|
///
|
||||||
pub companies: i64,
|
pub companies: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
|
@ -43,7 +43,7 @@ impl Repository {
|
||||||
pub fn select(
|
pub fn select(
|
||||||
&self,
|
&self,
|
||||||
conn: &diesel::PgConnection,
|
conn: &diesel::PgConnection,
|
||||||
id: i64,
|
id: i32,
|
||||||
) -> Result<Option<models::Member>, Error> {
|
) -> Result<Option<models::Member>, Error> {
|
||||||
match api_kgon_members::table
|
match api_kgon_members::table
|
||||||
.find(id)
|
.find(id)
|
||||||
|
@ -178,7 +178,7 @@ impl Repository {
|
||||||
pub fn update(
|
pub fn update(
|
||||||
&self,
|
&self,
|
||||||
conn: &diesel::PgConnection,
|
conn: &diesel::PgConnection,
|
||||||
id: i64,
|
id: i32,
|
||||||
modify: &models::ModifyMember,
|
modify: &models::ModifyMember,
|
||||||
) -> Result<u64, Error> {
|
) -> Result<u64, Error> {
|
||||||
use api_kgon_members::dsl;
|
use api_kgon_members::dsl;
|
||||||
|
@ -193,7 +193,7 @@ impl Repository {
|
||||||
pub fn update_balance(
|
pub fn update_balance(
|
||||||
&self,
|
&self,
|
||||||
conn: &diesel::PgConnection,
|
conn: &diesel::PgConnection,
|
||||||
id: i64,
|
id: i32,
|
||||||
modify: &models::ModifyMemberForBalance,
|
modify: &models::ModifyMemberForBalance,
|
||||||
) -> Result<u64, Error> {
|
) -> Result<u64, Error> {
|
||||||
use api_kgon_members::dsl;
|
use api_kgon_members::dsl;
|
||||||
|
@ -205,7 +205,7 @@ impl Repository {
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
pub fn delete(&self, conn: &diesel::PgConnection, id: i64) -> Result<u64, Error> {
|
pub fn delete(&self, conn: &diesel::PgConnection, id: i32) -> Result<u64, Error> {
|
||||||
use api_kgon_members::dsl;
|
use api_kgon_members::dsl;
|
||||||
|
|
||||||
diesel::delete(api_kgon_members::table.filter(dsl::id.eq(id)))
|
diesel::delete(api_kgon_members::table.filter(dsl::id.eq(id)))
|
||||||
|
|
|
@ -5,15 +5,15 @@ table! {
|
||||||
///
|
///
|
||||||
api_kgon_members(id) {
|
api_kgon_members(id) {
|
||||||
///
|
///
|
||||||
id -> BigInt,
|
id -> Integer,
|
||||||
///
|
///
|
||||||
balance -> BigInt,
|
balance -> Integer,
|
||||||
///
|
///
|
||||||
balance_bota -> BigInt,
|
balance_bota -> Integer,
|
||||||
///
|
///
|
||||||
balance_sum -> BigInt,
|
balance_sum -> Integer,
|
||||||
///
|
///
|
||||||
companies -> BigInt,
|
companies -> Integer,
|
||||||
///
|
///
|
||||||
oriental_play -> Text,
|
oriental_play -> Text,
|
||||||
///
|
///
|
||||||
|
|
|
@ -14,7 +14,7 @@ pub struct SynchronizationHistory {
|
||||||
///
|
///
|
||||||
pub complete_at: i64,
|
pub complete_at: i64,
|
||||||
///
|
///
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
///
|
///
|
||||||
pub message: Option<String>,
|
pub message: Option<String>,
|
||||||
///
|
///
|
||||||
|
@ -32,7 +32,7 @@ pub struct NewSynchronizationHistory {
|
||||||
///
|
///
|
||||||
pub complete_at: i64,
|
pub complete_at: i64,
|
||||||
///
|
///
|
||||||
pub code: i64,
|
pub code: i32,
|
||||||
///
|
///
|
||||||
pub message: Option<String>,
|
pub message: Option<String>,
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ pub struct FindAllSearch {
|
||||||
///
|
///
|
||||||
pub item: Option<String>,
|
pub item: Option<String>,
|
||||||
///
|
///
|
||||||
pub code: Option<i64>,
|
pub code: Option<i32>,
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
@ -13,7 +13,7 @@ table! {
|
||||||
///
|
///
|
||||||
complete_at -> BigInt,
|
complete_at -> BigInt,
|
||||||
///
|
///
|
||||||
code -> BigInt,
|
code -> Integer,
|
||||||
///
|
///
|
||||||
message -> Nullable<Text>,
|
message -> Nullable<Text>,
|
||||||
///
|
///
|
||||||
|
|
50
src/repositories/vendor/models.rs
vendored
50
src/repositories/vendor/models.rs
vendored
|
@ -6,11 +6,11 @@ use beteran_common_rust as bcr;
|
||||||
#[table_name = "api_kgon_vendors"]
|
#[table_name = "api_kgon_vendors"]
|
||||||
pub struct Vendor {
|
pub struct Vendor {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub company_id: i64,
|
pub company_id: i32,
|
||||||
///
|
///
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
///
|
///
|
||||||
pub key: String,
|
pub key: String,
|
||||||
///
|
///
|
||||||
|
@ -18,13 +18,13 @@ pub struct Vendor {
|
||||||
///
|
///
|
||||||
pub category: String,
|
pub category: String,
|
||||||
///
|
///
|
||||||
pub max_bet_casino: i64,
|
pub max_bet_casino: i32,
|
||||||
///
|
///
|
||||||
pub max_bet_slot: i64,
|
pub max_bet_slot: i32,
|
||||||
///
|
///
|
||||||
pub is_enable: String,
|
pub is_enable: String,
|
||||||
///
|
///
|
||||||
pub bet_count: i64,
|
pub bet_count: i32,
|
||||||
///
|
///
|
||||||
pub created_at: i64,
|
pub created_at: i64,
|
||||||
///
|
///
|
||||||
|
@ -36,11 +36,11 @@ pub struct Vendor {
|
||||||
#[table_name = "api_kgon_vendors"]
|
#[table_name = "api_kgon_vendors"]
|
||||||
pub struct NewVendor {
|
pub struct NewVendor {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub company_id: i64,
|
pub company_id: i32,
|
||||||
///
|
///
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
///
|
///
|
||||||
pub key: String,
|
pub key: String,
|
||||||
///
|
///
|
||||||
|
@ -48,13 +48,13 @@ pub struct NewVendor {
|
||||||
///
|
///
|
||||||
pub category: String,
|
pub category: String,
|
||||||
///
|
///
|
||||||
pub max_bet_casino: i64,
|
pub max_bet_casino: i32,
|
||||||
///
|
///
|
||||||
pub max_bet_slot: i64,
|
pub max_bet_slot: i32,
|
||||||
///
|
///
|
||||||
pub is_enable: String,
|
pub is_enable: String,
|
||||||
///
|
///
|
||||||
pub bet_count: i64,
|
pub bet_count: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -62,9 +62,9 @@ pub struct NewVendor {
|
||||||
#[table_name = "api_kgon_vendors"]
|
#[table_name = "api_kgon_vendors"]
|
||||||
pub struct ModifyVendor {
|
pub struct ModifyVendor {
|
||||||
///
|
///
|
||||||
pub company_id: i64,
|
pub company_id: i32,
|
||||||
///
|
///
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
///
|
///
|
||||||
pub key: String,
|
pub key: String,
|
||||||
///
|
///
|
||||||
|
@ -72,13 +72,13 @@ pub struct ModifyVendor {
|
||||||
///
|
///
|
||||||
pub category: String,
|
pub category: String,
|
||||||
///
|
///
|
||||||
pub max_bet_casino: i64,
|
pub max_bet_casino: i32,
|
||||||
///
|
///
|
||||||
pub max_bet_slot: i64,
|
pub max_bet_slot: i32,
|
||||||
///
|
///
|
||||||
pub is_enable: String,
|
pub is_enable: String,
|
||||||
///
|
///
|
||||||
pub bet_count: i64,
|
pub bet_count: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -86,11 +86,11 @@ pub struct ModifyVendor {
|
||||||
#[table_name = "api_kgon_vendors"]
|
#[table_name = "api_kgon_vendors"]
|
||||||
pub struct UpsertVendor {
|
pub struct UpsertVendor {
|
||||||
///
|
///
|
||||||
pub id: i64,
|
pub id: i32,
|
||||||
///
|
///
|
||||||
pub company_id: i64,
|
pub company_id: i32,
|
||||||
///
|
///
|
||||||
pub vendor_id: i64,
|
pub vendor_id: i32,
|
||||||
///
|
///
|
||||||
pub key: String,
|
pub key: String,
|
||||||
///
|
///
|
||||||
|
@ -98,22 +98,22 @@ pub struct UpsertVendor {
|
||||||
///
|
///
|
||||||
pub category: String,
|
pub category: String,
|
||||||
///
|
///
|
||||||
pub max_bet_casino: i64,
|
pub max_bet_casino: i32,
|
||||||
///
|
///
|
||||||
pub max_bet_slot: i64,
|
pub max_bet_slot: i32,
|
||||||
///
|
///
|
||||||
pub is_enable: String,
|
pub is_enable: String,
|
||||||
///
|
///
|
||||||
pub bet_count: i64,
|
pub bet_count: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FindAllSearch {
|
pub struct FindAllSearch {
|
||||||
///
|
///
|
||||||
pub company_id: Option<i64>,
|
pub company_id: Option<i32>,
|
||||||
///
|
///
|
||||||
pub vendor_id: Option<i64>,
|
pub vendor_id: Option<i32>,
|
||||||
///
|
///
|
||||||
pub key_like: Option<String>,
|
pub key_like: Option<String>,
|
||||||
///
|
///
|
||||||
|
|
6
src/repositories/vendor/repository.rs
vendored
6
src/repositories/vendor/repository.rs
vendored
|
@ -72,7 +72,7 @@ impl Repository {
|
||||||
pub fn select(
|
pub fn select(
|
||||||
&self,
|
&self,
|
||||||
conn: &diesel::PgConnection,
|
conn: &diesel::PgConnection,
|
||||||
id: i64,
|
id: i32,
|
||||||
) -> Result<Option<models::Vendor>, Error> {
|
) -> Result<Option<models::Vendor>, Error> {
|
||||||
match api_kgon_vendors::table
|
match api_kgon_vendors::table
|
||||||
.find(id)
|
.find(id)
|
||||||
|
@ -241,7 +241,7 @@ impl Repository {
|
||||||
pub fn update(
|
pub fn update(
|
||||||
&self,
|
&self,
|
||||||
conn: &diesel::PgConnection,
|
conn: &diesel::PgConnection,
|
||||||
id: i64,
|
id: i32,
|
||||||
modify: &models::ModifyVendor,
|
modify: &models::ModifyVendor,
|
||||||
) -> Result<u64, Error> {
|
) -> Result<u64, Error> {
|
||||||
use api_kgon_vendors::dsl;
|
use api_kgon_vendors::dsl;
|
||||||
|
@ -253,7 +253,7 @@ impl Repository {
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
pub fn delete(&self, conn: &diesel::PgConnection, id: i64) -> Result<u64, Error> {
|
pub fn delete(&self, conn: &diesel::PgConnection, id: i32) -> Result<u64, Error> {
|
||||||
use api_kgon_vendors::dsl;
|
use api_kgon_vendors::dsl;
|
||||||
|
|
||||||
diesel::delete(api_kgon_vendors::table.filter(dsl::id.eq(id)))
|
diesel::delete(api_kgon_vendors::table.filter(dsl::id.eq(id)))
|
||||||
|
|
12
src/repositories/vendor/schema.rs
vendored
12
src/repositories/vendor/schema.rs
vendored
|
@ -5,11 +5,11 @@ table! {
|
||||||
///
|
///
|
||||||
api_kgon_vendors(id) {
|
api_kgon_vendors(id) {
|
||||||
///
|
///
|
||||||
id -> BigInt,
|
id -> Integer,
|
||||||
///
|
///
|
||||||
company_id -> BigInt,
|
company_id -> Integer,
|
||||||
///
|
///
|
||||||
vendor_id -> BigInt,
|
vendor_id -> Integer,
|
||||||
///
|
///
|
||||||
key -> Text,
|
key -> Text,
|
||||||
///
|
///
|
||||||
|
@ -17,13 +17,13 @@ table! {
|
||||||
///
|
///
|
||||||
category -> Text,
|
category -> Text,
|
||||||
///
|
///
|
||||||
max_bet_casino -> BigInt,
|
max_bet_casino -> Integer,
|
||||||
///
|
///
|
||||||
max_bet_slot -> BigInt,
|
max_bet_slot -> Integer,
|
||||||
///
|
///
|
||||||
is_enable -> Text,
|
is_enable -> Text,
|
||||||
///
|
///
|
||||||
bet_count -> BigInt,
|
bet_count -> Integer,
|
||||||
///
|
///
|
||||||
created_at -> BigInt,
|
created_at -> BigInt,
|
||||||
///
|
///
|
||||||
|
|
|
@ -68,7 +68,7 @@ impl Scheduler {
|
||||||
&'static self,
|
&'static self,
|
||||||
item: String,
|
item: String,
|
||||||
start_at: i64,
|
start_at: i64,
|
||||||
code: i64,
|
code: i32,
|
||||||
message: Option<String>,
|
message: Option<String>,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let conn = self.pool.get().expect("conn");
|
let conn = self.pool.get().expect("conn");
|
||||||
|
|
|
@ -65,7 +65,7 @@ impl Scheduler {
|
||||||
&'static self,
|
&'static self,
|
||||||
item: String,
|
item: String,
|
||||||
start_at: i64,
|
start_at: i64,
|
||||||
code: i64,
|
code: i32,
|
||||||
message: Option<String>,
|
message: Option<String>,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let complete_at = (chrono::Utc::now()).timestamp();
|
let complete_at = (chrono::Utc::now()).timestamp();
|
||||||
|
|
|
@ -63,7 +63,7 @@ impl Scheduler {
|
||||||
&'static self,
|
&'static self,
|
||||||
item: String,
|
item: String,
|
||||||
start_at: i64,
|
start_at: i64,
|
||||||
code: i64,
|
code: i32,
|
||||||
message: Option<String>,
|
message: Option<String>,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let conn = self.pool.get().expect("conn");
|
let conn = self.pool.get().expect("conn");
|
||||||
|
|
2
src/schedulers/vendor/scheduler.rs
vendored
2
src/schedulers/vendor/scheduler.rs
vendored
|
@ -63,7 +63,7 @@ impl Scheduler {
|
||||||
&'static self,
|
&'static self,
|
||||||
item: String,
|
item: String,
|
||||||
start_at: i64,
|
start_at: i64,
|
||||||
code: i64,
|
code: i32,
|
||||||
message: Option<String>,
|
message: Option<String>,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let complete_at = (chrono::Utc::now()).timestamp();
|
let complete_at = (chrono::Utc::now()).timestamp();
|
||||||
|
|
|
@ -105,8 +105,8 @@ impl Service {
|
||||||
search: match request.search {
|
search: match request.search {
|
||||||
Some(s) => Some(repositories::vendor::models::FindAllSearch {
|
Some(s) => Some(repositories::vendor::models::FindAllSearch {
|
||||||
name_like: s.name_like,
|
name_like: s.name_like,
|
||||||
company_id: s.company_id.map(|d| d as i64),
|
company_id: s.company_id.map(|d| d as i32),
|
||||||
vendor_id: s.vendor_id.map(|d| d as i64),
|
vendor_id: s.vendor_id.map(|d| d as i32),
|
||||||
key_like: s.key_like,
|
key_like: s.key_like,
|
||||||
category_like: s.category_like,
|
category_like: s.category_like,
|
||||||
is_enable: s.is_enable,
|
is_enable: s.is_enable,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user