Documentation ¶
Index ¶
- Constants
- func GetFileURL(ctx context.Context, path string) (*url.URL, error)
- func GetKey(ctx context.Context, accountName, accountPass string) (managerId, apiKey string, err error)
- func MustGetFileURL(ctx context.Context, path string) *url.URL
- func MustGetKey(ctx context.Context, accountName, accountPass string) (managerId, apiKey string)
- func MustRequest(ctx context.Context, path string, body url.Values, dest ...interface{})
- func Params(keysAndValues ...interface{}) url.Values
- func Request(ctx context.Context, path string, body url.Values, dest ...interface{}) error
- type BasicStandard
- type Client
- type Device
- type Exam
- type ExamWithStandards
- type Gym
- type ResponseError
- type ScoreXY
- type ScoreXYByBodyParts
- type StandardRange
- type StandardValue
- type StandardValues
- type Timestamp
Constants ¶
View Source
const ( API_PREFIX = "https://www.zhaiker.cn" API_GET_KEY = "/open/OpenAPI!apiKey.m" API_GET_GYMS = "/open/OpenAPI!getGyms.m" API_GET_EXAMS = "/open/OpenAPI!getExams.m" API_GET_EXAMS_COUNT = "/open/OpenAPI!getExamsCount.m" API_GET_EXAM = "/open/OpenAPI!getExamById.m" API_START_EXAM = "/open/OpenAPI!startExam.m" API_CANCEL_EXAM = "/open/OpenAPI!cancelExam.m" API_GET_DEVICE = "/open/OpenAPI!getExamState.m" API_GET_FILE = "/file/FileAction!loadFile.msg" )
Variables ¶
This section is empty.
Functions ¶
func GetFileURL ¶
GetFileURL gets the URL of image path key.
func GetKey ¶
func GetKey(ctx context.Context, accountName, accountPass string) (managerId, apiKey string, err error)
GetKey gets api key with account name and password.
func MustGetFileURL ¶
MustGetFileURL gets the URL of image path key, panics if operation fails.
func MustGetKey ¶
MustGetKey gets api key with account name and password, panics if operation fails.
func MustRequest ¶
MustRequest makes an HTTP request to path with body params, unmarshals json response to pointer-key pair destinations, panics if operation fails.
Types ¶
type BasicStandard ¶
type BasicStandard struct { BmaxpStandard StandardValue BmiStandard StandardValue BminpStandard StandardValue BmrStandard StandardValue BoneStandard StandardValue BottomFat float64 BottomMuscle float64 FatStandard StandardValue HeartStandard StandardValue HeightStandard StandardValue MuscleStandard StandardValue ProteinStandard StandardValue ReactionStandard StandardValue SubfatStandard StandardValue TopFat float64 TopMuscle float64 TrunkFat float64 TrunkMuscle float64 VisfatStandard StandardValue WaterStandard StandardValue WeightStandard StandardValue WhrStandard StandardValue }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Exam ¶
type Exam struct { AerobicGoal float64 Age int Agility int AnaGoal float64 Balance int BalanceAngle float64 BloodMaxPressure int BloodMinPressure int BloodOxygen int Bmi float64 Bmr float64 BodyAge int BodyDetect *ScoreXYByBodyParts BodyImage string BodyShape int BodyShapeRisk int Bone float64 CaloriesInput float64 CustomerID string DeviceFrom string EnduGoal float64 Fat float64 FatControl float64 FatLeftArm float64 FatLeftLeg float64 FatRightArm float64 FatRightLeg float64 FatTrunk float64 GmtCreate Timestamp GmtModify Timestamp GymID string GymName string HeartFun int Height float64 Hips float64 HumpbackRisk int Id string InFat float64 Language string LegRisk string Muscle float64 MuscleControl float64 MuscleLeftArm float64 MuscleLeftLeg float64 MuscleRightArm float64 MuscleRightLeg float64 MuscleTrunk float64 Name string PelvisRisk int PerfectWeight float64 Phone string PostureRisk int Protein float64 R100LeftArm float64 R100LeftLeg float64 R100RightArm float64 R100RightLeg float64 R100Trunk float64 R20LeftArm float64 R20LeftLeg float64 R20RightArm float64 R20RightLeg float64 R20Trunk float64 RestingHeartRate int Score int Sex string ShoulderRisk int SideBodyDetect *ScoreXYByBodyParts SideImage string SportGoal float64 SportLevel int SportSafeRisk int SubFat float64 UnitType string UserID string VitalCapacity int Waist float64 Water float64 Wc float64 Weight float64 WeightControl float64 }
type ExamWithStandards ¶
type ExamWithStandards struct { Exam *Exam BasicStandard *BasicStandard WeightGrowthStandard *StandardValues HeightGrowthStandard *StandardValues }
func (*ExamWithStandards) UnmarshalJSON ¶
func (s *ExamWithStandards) UnmarshalJSON(data []byte) error
type ResponseError ¶
type ResponseError struct { Code int `json:"CODE"` Message string `json:"INFO"` OK bool `json:"STATUS"` }
func (ResponseError) Error ¶
func (e ResponseError) Error() string
type ScoreXYByBodyParts ¶
type ScoreXYByBodyParts struct { BodyDirection int FullBody bool LeftAnkle ScoreXY LeftEar ScoreXY LeftElbow ScoreXY LeftEye ScoreXY LeftHip ScoreXY LeftKnee ScoreXY LeftMouthCorner ScoreXY LeftShoulder ScoreXY LeftWrist ScoreXY Neck ScoreXY Nose ScoreXY RightAnkle ScoreXY RightEar ScoreXY RightElbow ScoreXY RightEye ScoreXY RightHip ScoreXY RightKnee ScoreXY RightMouthCorner ScoreXY RightShoulder ScoreXY RightWrist ScoreXY TopHead ScoreXY }
func (*ScoreXYByBodyParts) UnmarshalJSON ¶
func (s *ScoreXYByBodyParts) UnmarshalJSON(data []byte) error
type StandardRange ¶
type StandardRange struct { Age int Fewer float64 Fewest float64 More float64 Most float64 Standard float64 }
func (StandardRange) AsStandardValue ¶
func (sr StandardRange) AsStandardValue() StandardValue
type StandardValue ¶
type StandardValue [6]float64
type StandardValues ¶
type StandardValues []StandardValue
Click to show internal directories.
Click to hide internal directories.