model

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	AreaId       string `json:"area_id"`
	AreaName     string `json:"area_name"`
	ParentAreaId string `json:"parent_area_id"`
}

Area 地区通用数据结构

func AreaFromCity

func AreaFromCity(area City) *Area

func AreaFromCounty

func AreaFromCounty(area County) *Area

func AreaFromProvince

func AreaFromProvince(area Province) *Area

func AreaListFromCity

func AreaListFromCity(areas []City) []Area

func AreaListFromCounty

func AreaListFromCounty(areas []County) []Area

func AreaListFromProvince

func AreaListFromProvince(areas []Province) []Area

type BigArea

type BigArea struct {
	ID       uint64     `json:"id"`
	AreaName string     `json:"area_name"`
	Province []Province `json:"province"`
}

type CascadeArea

type CascadeArea struct {
	Province Province `json:"province"`
	City     City     `json:"city"`
	County   County   `json:"county"`
}

CascadeArea 级联地区

func CascadeAreaFromAreas

func CascadeAreaFromAreas(province Province, city City, county County) *CascadeArea

type City

type City struct {
	ID            uint64 `json:"id"`
	AreaName      string `json:"area_name"`
	AreaId        string `json:"area_id"`
	ShortAreaName string `json:"short_area_name"`
	ParentId      string `json:"parent_id"`
	ParentName    string `json:"parent_name"`
	IsOpen        uint8  `json:"is_open"`
	IsHot         uint8  `json:"is_hot"`
}

func CityFromModel

func CityFromModel(area common.City) *City

func CityListFromModel

func CityListFromModel(areas []common.City) []City

type County

type County struct {
	ID         uint64 `json:"id"`
	AreaName   string `json:"area_name"`
	AreaId     string `json:"area_id"`
	ParentId   string `json:"parent_id"`
	ParentName string `json:"parent_name"`
}

func CountyFromModel

func CountyFromModel(area common.County) *County

func CountyListFromModel

func CountyListFromModel(areas []common.County) []County

type MailConfig

type MailConfig struct {
	ID        uint64 `json:"id"`
	User      string `json:"user"`
	FromName  string `json:"from_name"`
	Transport string `json:"transport"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Host      string `json:"host"`
	Port      int    `json:"port"`
}

func MailConfigFormModel

func MailConfigFormModel(config *common.MailConfig) *MailConfig

func (*MailConfig) ToModel

func (c *MailConfig) ToModel() *common.MailConfig

type Province

type Province struct {
	ID            uint64 `json:"id"`
	AreaName      string `json:"area_name"`
	ShortAreaName string `json:"short_area_name"`
	AreaId        string `json:"area_id"`
	BigAreaID     uint64 `json:"big_area_id"`
}

func ProvinceFromModel

func ProvinceFromModel(area common.Province) *Province

func ProvinceListFromModel

func ProvinceListFromModel(areas []common.Province) []Province

type SenderType

type SenderType string

SenderType 消息发送者类型

const (
	SmsSender   SenderType = "sms"
	EmailSender SenderType = "email"
)

type SmsConfig

type SmsConfig struct {
	ID              uint64 `json:"id"`
	SmsType         string `json:"sms_type"`
	AppKey          string `json:"app_key"`
	SecretKey       string `json:"secret_key"`
	FreeSignName    string `json:"free_sign_name"`
	ValidCodeExpire uint   `json:"valid_code_expire"`
}

func SmsConfigFromModel

func SmsConfigFromModel(dataModel *common.SmsConfig) *SmsConfig

func (*SmsConfig) ToModel

func (conf *SmsConfig) ToModel() *common.SmsConfig

type SmsTemplate

type SmsTemplate struct {
	ID           uint64
	TemplateName string
	Template     string
	TemplateId   string
}

func SmsTemplateFromModel

func SmsTemplateFromModel(dataModel *common.SmsTemplate) *SmsTemplate

func (*SmsTemplate) ToModel

func (template *SmsTemplate) ToModel() *common.SmsTemplate

type ValidCode

type ValidCode struct {
	Code   string `redis:"code"`
	Expire int64  `redis:"expire"`
	Time   int64  `redis:"time"`
}

ValidCode 验证码结构

Jump to

Keyboard shortcuts

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