Documentation
¶
Index ¶
- Constants
- func CodeToMessage(code Code, msg string) string
- func JSONMiddleware() gin.HandlerFunc
- func RebuildBills() (err error)
- type BatchRecordRequest
- type Bill
- type Code
- type DeleteRecordRequest
- type DeleteRecordResponse
- type DeletedBill
- type GetBaseInfosResponse
- type GetDayRecordsRequest
- type GetDayRecordsResponse
- type GetDeletedRecordsResponse
- type GetRecordsRequest
- type GetRecordsResponse
- type GroupEnterCodesRequest
- type GroupEnterCodesResponse
- type GroupNewRequest
- type GroupNewResponse
- type IDName
- type LoginRequest
- type LoginResponse
- type MerchantWallets
- type PersonWallets
- type RecordRequest
- type RegisterRequest
- type RegisterResponse
- type ResponseWrapper
- type Server
- type StatAllResponse
- type StatMonth
- type StatSeason
- type StatWeek
- type StatWeekDay
- type StatYear
- type Statistics
- type StatisticsResponse
- type WalletNewByDirRequest
- type WalletNewRequest
- type WalletNewResponse
- type WalletWithInfo
Constants ¶
View Source
const ( CodeErrorStart = iota + 100 CodeProtocol CodeMissArgs CodeInvalidArgs CodeInternalError CodeVerifyFailed CodeInvalidToken CodeNeedAuth CodeDisabled )
View Source
const (
MsgNoRecordID = "缺失记录ID"
)
Variables ¶
This section is empty.
Functions ¶
func CodeToMessage ¶
func JSONMiddleware ¶
func JSONMiddleware() gin.HandlerFunc
func RebuildBills ¶
func RebuildBills() (err error)
Types ¶
type BatchRecordRequest ¶
type BatchRecordRequest struct {
Records []RecordRequest `json:"records"`
}
func (*BatchRecordRequest) Valid ¶
func (req *BatchRecordRequest) Valid() bool
type Bill ¶
type Bill struct {
ID string `json:"id"`
FromSubWalletID string `json:"fromSubWalletID"`
FromSubWalletName string `json:"fromSubWalletName"`
ToSubWalletID string `json:"toSubWalletID"`
ToSubWalletName string `json:"toSubWalletName"`
CostDir model.CostDir `json:"costDir"`
Amount int `json:"amount"`
LabelIDs []string `json:"labelIDs"`
LabelIDNames []string `json:"labelIDNames"`
Remark string `json:"remark"`
LossAmount int `json:"lossAmount"`
LossWalletID string `json:"lossWalletID"`
LossWalletName string `json:"lossWalletName"`
At int64 `json:"at"`
AtS string `json:"atS"`
FromPersonName string `json:"fromPersonName"`
ToPersonName string `json:"toPersonName"`
OperationID string `json:"operationID"`
OperationName string `json:"operationName"`
}
type DeleteRecordRequest ¶
type DeleteRecordRequest struct {
RequestStat bool `json:"requestStat"`
StatLabelIDs []string `json:"statLabelIDs"` // empty: all; [] 0: no label record; labelID: label id record
DStatLabelIDs []uint64 `json:"-"`
}
func (*DeleteRecordRequest) Valid ¶
func (req *DeleteRecordRequest) Valid() bool
type DeleteRecordResponse ¶
type DeleteRecordResponse struct {
DayStatistics Statistics `json:"dayStatistics"`
WeekStatistics Statistics `json:"weekStatistics"`
MonthStatistics Statistics `json:"monthStatistics"`
SeasonStatistics Statistics `json:"seasonStatistics"`
YearStatistics Statistics `json:"yearStatistics"`
}
type DeletedBill ¶
type GetBaseInfosResponse ¶
type GetBaseInfosResponse struct {
MerchantWallets []MerchantWallets `json:"merchantWallets"`
SelfWallets MerchantWallets `json:"selfWallets"`
Labels []IDName `json:"labels"`
Groups []IDName `json:"groups"`
}
type GetDayRecordsRequest ¶
type GetDayRecordsRequest struct {
Year int `json:"year"`
Month int `json:"month"`
Day int `json:"day"`
}
func (*GetDayRecordsRequest) Valid ¶
func (req *GetDayRecordsRequest) Valid() bool
type GetDayRecordsResponse ¶
type GetDayRecordsResponse struct {
Bills []Bill `json:"bills"`
}
type GetDeletedRecordsResponse ¶
type GetDeletedRecordsResponse struct {
Bills []DeletedBill `json:"bills"`
}
type GetRecordsRequest ¶
type GetRecordsRequest struct {
RecordID string `json:"recordID"`
PageCount int `json:"pageCount"`
GroupID string `json:"groupID"`
NewForward bool `json:"newForward"`
RequestStat bool `json:"requestStat"`
StatLabelIDs []string `json:"statLabelIDs"` // empty: all; [] 0: no label record; labelID: label id record
DStatLabelIDs []uint64 `json:"-"`
}
func (*GetRecordsRequest) Valid ¶
func (req *GetRecordsRequest) Valid() bool
type GetRecordsResponse ¶
type GetRecordsResponse struct {
Bills []Bill `json:"bills"`
HasMore bool `json:"hasMore"`
DayStatistics Statistics `json:"dayStatistics"`
WeekStatistics Statistics `json:"weekStatistics"`
MonthStatistics Statistics `json:"monthStatistics"`
SeasonStatistics Statistics `json:"seasonStatistics"`
YearStatistics Statistics `json:"yearStatistics"`
}
type GroupEnterCodesRequest ¶
func (*GroupEnterCodesRequest) Valid ¶
func (req *GroupEnterCodesRequest) Valid() bool
type GroupEnterCodesResponse ¶
type GroupNewRequest ¶
type GroupNewRequest struct {
Name string
}
func (*GroupNewRequest) Valid ¶
func (req *GroupNewRequest) Valid() bool
type GroupNewResponse ¶
type GroupNewResponse struct {
ID string `json:"id"`
}
type LoginRequest ¶
func (*LoginRequest) Valid ¶
func (req *LoginRequest) Valid() bool
type LoginResponse ¶
type MerchantWallets ¶
type MerchantWallets struct {
PersonID string `json:"personID"`
PersonName string `json:"personName"`
CostDir model.CostDir `json:"costDir"`
Wallets []*WalletWithInfo `json:"wallets"`
}
type PersonWallets ¶
type PersonWallets struct {
PersonID string `json:"personID"`
PersonName string `json:"personName"`
Wallets []*WalletWithInfo `json:"wallets"`
}
type RecordRequest ¶
type RecordRequest struct {
FromSubWalletID string `json:"fromSubWalletID"`
ToSubWalletID string `json:"toSubWalletID"`
Amount int `json:"amount"`
LabelIDs []string `json:"labelIDs"`
Remark string `json:"remark"`
LossAmount int `json:"lossAmount"`
LossWalletID string `json:"lossWalletID"`
At int64 `json:"at"`
DFromSubWalletID uint64 `json:"-"`
DToSubWalletID uint64 `json:"-"`
DLabelIDs []uint64 `json:"-"`
DLossWalletID uint64 `json:"-"`
}
func (*RecordRequest) Valid ¶
func (req *RecordRequest) Valid() (ok bool)
type RegisterRequest ¶
func (*RegisterRequest) Valid ¶
func (req *RegisterRequest) Valid() bool
type RegisterResponse ¶
type ResponseWrapper ¶
type ResponseWrapper struct {
Code Code `json:"code"`
Message string `json:"message"`
Resp interface{} `json:"resp,omitempty"`
}
func (*ResponseWrapper) Apply ¶
func (wr *ResponseWrapper) Apply(code Code, msg string)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type StatAllResponse ¶
type StatAllResponse struct {
Years []StatYear `json:"years"`
}
type StatMonth ¶
type StatMonth struct {
Month int `json:"month"`
Stat ex.LifeCostTotalData `json:"stat"`
Weeks []StatWeek `json:"weeks"`
}
type StatSeason ¶
type StatSeason struct {
Season int `json:"season"`
Stat ex.LifeCostTotalData `json:"stat"`
Months []StatMonth `json:"months"`
}
type StatWeek ¶
type StatWeek struct {
Week int `json:"week"`
Stat ex.LifeCostTotalData `json:"stat"`
Days []StatWeekDay `json:"days"`
}
type StatWeekDay ¶
type StatWeekDay struct {
WeekDay int `json:"weekDay"`
MonthDay int `json:"monthDay"`
Stat ex.LifeCostTotalData `json:"stat"`
}
type StatYear ¶
type StatYear struct {
Year int `json:"year"`
Stat ex.LifeCostTotalData `json:"stat"`
Seasons []StatSeason `json:"seasons"`
}
type Statistics ¶
type StatisticsResponse ¶
type StatisticsResponse struct {
DayStatistics Statistics `json:"dayStatistics"`
WeekStatistics Statistics `json:"weekStatistics"`
MonthStatistics Statistics `json:"monthStatistics"`
SeasonStatistics Statistics `json:"seasonStatistics"`
YearStatistics Statistics `json:"yearStatistics"`
}
type WalletNewByDirRequest ¶
type WalletNewByDirRequest struct {
GroupID string `json:"groupID"`
NewWalletName string `json:"newWalletName"`
Dir model.CostDir `json:"dir"`
}
func (*WalletNewByDirRequest) Valid ¶
func (req *WalletNewByDirRequest) Valid() bool
type WalletNewRequest ¶
type WalletNewRequest struct {
Name string `json:"name"`
}
func (*WalletNewRequest) Valid ¶
func (req *WalletNewRequest) Valid() bool
type WalletNewResponse ¶
type WalletNewResponse struct {
ID string `json:"id"`
}
type WalletWithInfo ¶
Click to show internal directories.
Click to hide internal directories.