mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
format code
This commit is contained in:
@@ -260,13 +260,13 @@ func (a *TransactionsApi) TransactionModifyHandler(c *core.Context) (interface{}
|
||||
removeTransactionTagIds := utils.Int64SliceMinus(transactionTagIds, tagIds)
|
||||
|
||||
newTransaction := &models.Transaction{
|
||||
TransactionId: transaction.TransactionId,
|
||||
Uid: uid,
|
||||
CategoryId: transactionModifyReq.CategoryId,
|
||||
TransactionTime: utils.GetMinTransactionTimeFromUnixTime(transactionModifyReq.Time),
|
||||
AccountId: transactionModifyReq.SourceAccountId,
|
||||
Amount: transactionModifyReq.SourceAmount,
|
||||
Comment: transactionModifyReq.Comment,
|
||||
TransactionId: transaction.TransactionId,
|
||||
Uid: uid,
|
||||
CategoryId: transactionModifyReq.CategoryId,
|
||||
TransactionTime: utils.GetMinTransactionTimeFromUnixTime(transactionModifyReq.Time),
|
||||
AccountId: transactionModifyReq.SourceAccountId,
|
||||
Amount: transactionModifyReq.SourceAmount,
|
||||
Comment: transactionModifyReq.Comment,
|
||||
}
|
||||
|
||||
if transaction.Type == models.TRANSACTION_DB_TYPE_TRANSFER_OUT {
|
||||
|
||||
@@ -38,7 +38,7 @@ func JWTAuthorization(c *core.Context) {
|
||||
}
|
||||
|
||||
// JWTAuthorizationByQueryString verifies whether current request is valid by jwt token
|
||||
func JWTAuthorizationByQueryString(c *core.Context) {
|
||||
func JWTAuthorizationByQueryString(c *core.Context) {
|
||||
token, exists := c.GetQuery(tokenQueryStringParam)
|
||||
|
||||
if !exists {
|
||||
|
||||
@@ -88,7 +88,7 @@ func (s *TransactionService) GetTransactionsByMaxTime(uid int64, maxTime int64,
|
||||
|
||||
if keyword != "" {
|
||||
condition = condition + " AND comment LIKE ?"
|
||||
conditionParams = append(conditionParams, "%%" + keyword + "%%")
|
||||
conditionParams = append(conditionParams, "%%"+keyword+"%%")
|
||||
}
|
||||
|
||||
if maxTime > 0 {
|
||||
@@ -174,7 +174,7 @@ func (s *TransactionService) GetTransactionsInMonthByPage(uid int64, year int, m
|
||||
|
||||
if keyword != "" {
|
||||
condition = condition + " AND comment LIKE ?"
|
||||
conditionParams = append(conditionParams, "%%" + keyword + "%%")
|
||||
conditionParams = append(conditionParams, "%%"+keyword+"%%")
|
||||
}
|
||||
|
||||
err = s.UserDataDB(uid).Where(condition, conditionParams...).Limit(count, count*(page-1)).OrderBy("transaction_time desc").Find(&transactions)
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ func PrintJsonSuccessResult(c *core.Context, result interface{}) {
|
||||
// PrintDataSuccessResult writes success response in custom content type to current http context
|
||||
func PrintDataSuccessResult(c *core.Context, contentType string, fileName string, result []byte) {
|
||||
if fileName != "" {
|
||||
c.Header("Content-Disposition", "attachment;filename=" + fileName)
|
||||
c.Header("Content-Disposition", "attachment;filename="+fileName)
|
||||
}
|
||||
|
||||
c.Data(http.StatusOK, contentType, result)
|
||||
|
||||
@@ -3,8 +3,8 @@ package utils
|
||||
import "time"
|
||||
|
||||
const (
|
||||
unixTimeFormat = "1136239445"
|
||||
longDateTimeFormat = "2006-01-02 15:04:05"
|
||||
unixTimeFormat = "1136239445"
|
||||
longDateTimeFormat = "2006-01-02 15:04:05"
|
||||
longDateTimeWithoutSecondFormat = "2006-01-02 15:04"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user