Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -299,7 +299,7 @@ func (a *API) FullDiscountFoodsList(poiCode, actID string) (actFoodsInfo *FullDi
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil, err
|
return actFoodsInfo, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量删除活动商品至指定商品满减活动
|
// 批量删除活动商品至指定商品满减活动
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ func TestFullDiscountBatchSave(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFullDiscountList(t *testing.T) {
|
func TestFullDiscountList(t *testing.T) {
|
||||||
result, err := api.FullDiscountList(testPoiCode, ActTypeStoreFullDiscount)
|
result, err := api.FullDiscountList("17626555", ActTypeStoreFullDiscount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ func TestFullDiscountList(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFullDiscountFoodsList(t *testing.T) {
|
func TestFullDiscountFoodsList(t *testing.T) {
|
||||||
result, err := api.FullDiscountFoodsList(testPoiCode, "497726932")
|
result, err := api.FullDiscountFoodsList("17626555", "9162539254")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -83,15 +83,29 @@ func TestRetailDiscountBatchSave(t *testing.T) {
|
|||||||
t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRetailDiscountList(t *testing.T) {
|
func TestRetailDiscountList(t *testing.T) { //56 1001
|
||||||
result, err := api.RetailDiscountList("9202390", RetailActTypeSecKill)
|
result, err := api.RetailDiscountList("17626555", 1001)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
for _, v := range result {
|
//for _, v := range result {
|
||||||
globals.SugarLogger.Debugf("%s", utils.Format4Output(v, false))
|
// globals.SugarLogger.Debugf("%s", utils.Format4Output(v, false))
|
||||||
|
//}
|
||||||
|
t.Log(utils.Format4Output(result, false))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestNew(t *testing.T) {
|
||||||
|
startTime := 1696831082 //2023-10-09 13:58:02
|
||||||
|
endTime := 1697090282 //2023-10-12 13:58:02
|
||||||
|
sTime := 1696089600 //2023-10-01 00:00:00
|
||||||
|
eTime := 1698768000 //2023-11-01 00:00:00
|
||||||
|
//fmt.Printf("1=%s", startTime < eTime && eTime < endTime)
|
||||||
|
//fmt.Printf("2=%s", startTime < sTime)
|
||||||
|
if sTime > endTime || eTime < startTime {
|
||||||
|
fmt.Println("false")
|
||||||
|
} else {
|
||||||
|
fmt.Println("true")
|
||||||
}
|
}
|
||||||
//t.Log(utils.Format4Output(result, false))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInStoreCouponList(t *testing.T) {
|
func TestInStoreCouponList(t *testing.T) {
|
||||||
@@ -113,7 +127,7 @@ func TestParseErr4RetailDiscountDelete(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetByAppPoiCodeAndType(t *testing.T) {
|
func TestGetByAppPoiCodeAndType(t *testing.T) {
|
||||||
result, err := api.GetByAppPoiCodeAndType("10305601", 1, 1)
|
result, err := api.GetByAppPoiCodeAndType("9472886", 1, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ func init() {
|
|||||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||||
|
|
||||||
//商超
|
//商超
|
||||||
|
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nngsVP37s-HXY86xe85H7Q") //token_n4TwqCntWWuvQwAawzxC0w
|
||||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_rfAD6OxSVxkTeCO1XmNCZg") //token_n4TwqCntWWuvQwAawzxC0w
|
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_rfAD6OxSVxkTeCO1XmNCZg") //token_n4TwqCntWWuvQwAawzxC0w
|
||||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w
|
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w
|
||||||
cookieStr := `
|
cookieStr := `
|
||||||
@@ -43,7 +44,7 @@ func TestAccessAPI(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetOAuthCode(t *testing.T) {
|
func TestGetOAuthCode(t *testing.T) {
|
||||||
result, err := api.GetOAuthCode("17395411")
|
result, err := api.GetOAuthCode("9472886")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -582,3 +582,21 @@ func TestGetStoreFreightDetail(t *testing.T) {
|
|||||||
fmt.Println(utils.Format4Output(detail, false))
|
fmt.Println(utils.Format4Output(detail, false))
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNew(t *testing.T) {
|
||||||
|
opTimeList := []int16{800, 2030, 2100, 2300}
|
||||||
|
timesLen := len(opTimeList) / 2 * 2
|
||||||
|
var strPairs []string
|
||||||
|
for i := 0; i < timesLen; i += 2 {
|
||||||
|
if opTimeList[i] != 0 {
|
||||||
|
strPairs = append(strPairs, JxOperationTime2StrTime(opTimeList[i])+"-"+JxOperationTime2StrTime(opTimeList[i+1]))
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println(strings.Join(strPairs, ","))
|
||||||
|
}
|
||||||
|
|
||||||
|
func JxOperationTime2StrTime(value int16) string {
|
||||||
|
return fmt.Sprintf("%02d:%02d", value/100, value%100)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user