group_power_test.go 1.11 KB
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3
package test

import (
chenweijian's avatar
chenweijian committed
4
	"fmt"
hujiebin's avatar
hujiebin committed
5
	"git.hilo.cn/hilo-common/domain"
chenweijian's avatar
chenweijian committed
6 7
	"git.hilo.cn/hilo-common/utils"
	"github.com/jinzhu/now"
hujiebin's avatar
hujiebin committed
8
	"hilo-group/domain/model/groupPower_m"
chenweijian's avatar
chenweijian committed
9
	"hilo-group/domain/model/group_m"
chenweijian's avatar
chenweijian committed
10
	"hilo-group/domain/service/group_power_s"
hujiebin's avatar
hujiebin committed
11
	"testing"
chenweijian's avatar
chenweijian committed
12
	"time"
hujiebin's avatar
hujiebin committed
13 14 15
)

func TestGetAllGroupPowerOwner(t *testing.T) {
chenweijian's avatar
chenweijian committed
16
	owners, _, err := groupPower_m.BatchGetAllGroupPowerUsers(domain.CreateModelNil(), 1, 1)
hujiebin's avatar
hujiebin committed
17 18
	println(owners, err)
}
19 20 21

func TestGetGroupPowerMonthStartTop1(t *testing.T) {
	res, err := groupPower_m.GetGroupPowerMonthStartTop1(domain.CreateModelNil(), 250)
chenweijian's avatar
chenweijian committed
22 23 24 25 26 27 28
	println(res, err)
}

func TestIsUseTRTC(t *testing.T) {
	if group_m.IsUseTRTC(domain.CreateModelNil(), "@TGS#3I57DMRIB") {
		fmt.Println("true--------------")
	}
29
}
chenweijian's avatar
chenweijian committed
30 31 32 33 34 35 36 37

func TestDoCalcGroupPowerMonthRankAct(t *testing.T) {
	lastDayTime := time.Now().AddDate(0, 0, -1)
	_now := now.New(lastDayTime)
	calcMonth := _now.BeginningOfMonth().Format(utils.MONTH_FORMAT)
	beginDate, endDate := _now.BeginningOfMonth().Format("2006-01-02"), _now.EndOfMonth().Format("2006-01-02")
	_ = group_power_s.DoCalcGroupPowerMonthRankAct(domain.CreateModelNil(), calcMonth, beginDate, endDate)
}