models

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS        = 200
	CREATED        = 201
	ERROR          = 500
	INVALID_PARAMS = 400

	ERROR_EXIST_REPORT     = 10001
	ERROR_NOT_EXIST_REPORT = 10002

	ERROR_AUTH_CHECK_TOKEN_FAIL    = 20001
	ERROR_AUTH_CHECK_TOKEN_TIMEOUT = 20002
	ERROR_AUTH_TOKEN               = 20003
	ERROR_AUTH                     = 20004
)

Variables

View Source
var MsgFlags = map[int]string{
	SUCCESS:                        "ok",
	CREATED:                        "ok",
	ERROR:                          "fail",
	INVALID_PARAMS:                 "请求参数错误",
	ERROR_EXIST_REPORT:             "作战报告已经存在",
	ERROR_NOT_EXIST_REPORT:         "作战报告不存在或者未找到",
	ERROR_AUTH_CHECK_TOKEN_FAIL:    "20001",
	ERROR_AUTH_CHECK_TOKEN_TIMEOUT: "20002",
	ERROR_AUTH_TOKEN:               "20003",
	ERROR_AUTH:                     "20004",
}

Functions

func AddReport

func AddReport(r Roguelike_Report, uuid uuid.UUID) (string, error)

func AddReports

func AddReports(r []Roguelike_Report, uuid uuid.UUID) ([]string, error)

func BindEmailToUUID

func BindEmailToUUID(nuuid uuid.UUID, email string) error

func CheckUUID

func CheckUUID(uuid u.UUID) (bool, error)

func DeleteReport

func DeleteReport(logid string) error

func GetMsg

func GetMsg(code int) string

func GetReportByID

func GetReportByID(logid string, result *Roguelike_Report_With_ID) error

func GetReportListByAccount

func GetReportListByAccount(uuid string, page int, pagesize int, result *[]Roguelike_Report_With_ID) error

func NewUUID

func NewUUID() (u.UUID, error)

Types

type Brief

type Brief struct {
	Duration int64  `json:"duration"`
	Endat    int64  `json:"endAt"`
	Squad    string `json:"squad"`
	Ending   string `json:"ending"`
}

type Initial

type Initial struct {
	RecruitGroup string   `json:"recruitGroup"`
	Recruits     []string `json:"recruits"`
	Support      string   `json:"support"`
}

type JSONResult

type JSONResult struct {
	Code    int         `json:"code" `
	Message string      `json:"msg"`
	Data    interface{} `json:"data"`
}

type Login

type Login struct {
	UUID string `json:"uuid" form:"uuid" example:"00000000-0000-0000-0000-000000000000"`
}

type NewToken

type NewToken struct {
	Token string `` /* 178-byte string literal not displayed */
}

type Node

type Node struct {
	Type        int      `json:"type"`
	Stage       string   `json:"stage"`
	Collections []string `json:"collections"`
	Select      []string `json:"select"`
	Capsules    []string `json:"capsules"`
	Tools       []string `json:"tools"`
	Tickets     []string `json:"tickets"`
	Recruits    []string `json:"recruits"`
	Upgrades    []string `json:"upgrades"`
	Shop        Shop     `json:"shop"`
}

type Recruits

type Recruits struct {
	Name     string `json:"name"`
	Upgraded bool   `json:"upgraded"`
}

type ReportID

type ReportID struct {
	ID string `bson:"_id" json:"id" example:"6213912d7f21c24ec55377ac"`
}

type ReportIDs

type ReportIDs struct {
	ID []string `bson:"_id" json:"id" example:"6213912d7f21c24ec55377ac,6213912d7f21c24ec55377aa"`
}

type Roguelike_Report

type Roguelike_Report struct {
	Theme       int        `json:"theme"`
	Mode        string     `json:"mode"`
	Collections []string   `json:"collections"`
	Brief       Brief      `json:"brief"`
	Recruits    []Recruits `json:"recruits"`
	Initial     Initial    `json:"initial"`
	Zones       []Zone     `json:"zones"`
}

type Roguelike_Report_With_ID

type Roguelike_Report_With_ID struct {
	ID               string `bson:"_id" json:"id"`
	Roguelike_Report `bson:",inline"`
}

type Roguelike_Report_With_UUID

type Roguelike_Report_With_UUID struct {
	UUID             interface{} `json:"uuid"`
	Roguelike_Report `bson:",inline"`
}

type Shop

type Shop struct {
	Buys   []Shop_Buy `json:"buys"`
	Invest int        `json:"inverst"`
}

type Shop_Buy

type Shop_Buy struct {
	Cost       int    `json:"cost"`
	Collection string `json:"collection"`
}

type Zone

type Zone struct {
	EnterZone  string   `json:"enterZone"`
	Variations []string `json:"variations"`
	NodeList   []Node   `json:"nodeList"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL