cmd

package
v0.0.0-...-64063fb Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2016 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "hicto",
	Short: "HiCTO 客户端命令行工具",
	Long:  "HiCTO 客户端命令行工具",

	PostRun: func(cmd *cobra.Command, args []string) {
		ResetFlags(cmd)
	},
}

This represents the base command when called without any subcommands

Functions

func Execute

func Execute() error

func GetCode

func GetCode(name string, key int32) string

func IgnoreErrorBool

func IgnoreErrorBool(b bool, err error) bool

func IgnoreErrorInt64

func IgnoreErrorInt64(i int64, err error) int64

func IgnoreErrorString

func IgnoreErrorString(s string, err error) string

func ListRecords

func ListRecords(records []interface{})

func ModelToRecord

func ModelToRecord(from interface{}, to interface{})

func ResetFlags

func ResetFlags(cmd *cobra.Command)

func ShowRecord

func ShowRecord(record interface{})

func StringInSlice

func StringInSlice(a string, list []string) bool

func ToCommentRecord

func ToCommentRecord(from *models.Comment) interface{}

func ToEmployeeRecord

func ToEmployeeRecord(from *models.Employee) interface{}

func ToExpertRecord

func ToExpertRecord(from *models.Expert) interface{}

func ToFeedbackRecord

func ToFeedbackRecord(from *models.Feedback) interface{}

func ToRecommendationRecord

func ToRecommendationRecord(from *models.Recommendation) interface{}

func ToReplyRecord

func ToReplyRecord(from *models.Reply) interface{}

func ToStarRecord

func ToStarRecord(from *models.Star) interface{}

func ToStartupRecord

func ToStartupRecord(from *models.Startup) interface{}

func ToTopicRecord

func ToTopicRecord(from *models.Topic) interface{}

func UpdateStartup

func UpdateStartup(id int64, reviewStatus int32, advice string)

func UsageFunc

func UsageFunc(cmd *cobra.Command) error

Types

type Comment

type Comment struct {
	ID                 string `chinese:"ID" list:"true"`
	TopicID            string `chinese:"问题ID" list:"true"`
	ReplyID            string `chinese:"答案ID" list:"true"`
	ReferCommentID     string `chinese:"评论ID" list:"true"`
	AuthorID           string `chinese:"评论作者ID" list:"true"`
	AuthorName         string `chinese:"评论作者姓名" list:"true"`
	Content            string `chinese:"内容" list:"true"`
	ReadableCreateTime string `chinese:"创建时间" list:"true"`
	ReadableUpdateTime string `chinese:"更新时间" list:"true"`
}

type Employee

type Employee struct {
	ID                             string `chinese:"ID" list:"true"`
	Name                           string `chinese:"姓名" list:"true"`
	Email                          string `chinese:"邮箱" list:"true"`
	Phone                          string `chinese:"电话"`
	StartupID                      string `chinese:"创业公司ID"`
	Position                       string `chinese:"职位" list:"true"`
	Admin                          string `chinese:"是否为管理员" list:"true"`
	ConsumeCtoCoins                string `chinese:"消费的悬赏分总额" list:"true"`
	TopicCount                     string `chinese:"问题总数" list:"true"`
	Avatar                         string `chinese:"头像"`
	Description                    string `chinese:"个人简介"`
	DeviceToken                    string `chinese:"设备token"`
	NotifyOnlyMyTopic              string `chinese:"是否只接收自己问题的通知"`
	NotifyCommentNewCommentByEmail string `chinese:"是否接收评论的新评论邮件通知"`
	NotifyCommentNewCommentByPush  string `chinese:"是否接收评论的新评论推送通知"`
	NotifyNewReplyByEmail          string `chinese:"是否接收问题的新答案邮件通知"`
	NotifyNewReplyByPush           string `chinese:"是否接收问题的新答案推送通知"`
	NotifyTopicNewCommentByEmail   string `chinese:"是否接收问题的新评论邮件通知"`
	NotifyTopicNewCommentByPush    string `chinese:"是否接收问题的新评论推送通知"`
	ReadableCreateTime             string `chinese:"创建时间" list:"true"`
	ReadableUpdateTime             string `chinese:"更新时间" list:"true"`
}

type Expert

type Expert struct {
	ID                             string `chinese:"ID" list:"true"`
	Name                           string `chinese:"姓名" list:"true"`
	Email                          string `chinese:"邮箱" list:"true"`
	Phone                          string `chinese:"电话"`
	City                           string `chinese:"城市" code:"city"`
	Company                        string `chinese:"公司"`
	Position                       string `chinese:"职位"`
	Expertise                      string `chinese:"专长" list:"true"`
	CtoCoins                       string `chinese:"悬赏分" list:"true"`
	Reputation                     string `chinese:"威望分"`
	ReplyCount                     string `chinese:"回答总数"`
	AcceptedReplyCount             string `chinese:"被采纳的答案数" list:"true"`
	Avatar                         string `chinese:"头像"`
	Description                    string `chinese:"个人简介"`
	DeviceToken                    string `chinese:"设备token"`
	ViewCount                      string `chinese:"浏览次数"`
	CoverImage                     string `chinese:"封面图片"`
	HelpedStartups                 string `chinese:"帮助过的创业公司"`
	Internal                       string `chinese:"是否为内部专家"`
	InviteQuota                    string `chinese:"可邀请专家数"`
	InviteUsed                     string `chinese:"已邀请专家数"`
	ManagementSkill                string `chinese:"管理技能" list:"true" code:"managementSkill"`
	NotifyNewTopicByPush           string `chinese:"是否接收新主题推送通知"`
	NotifyOnlyFreeTime             string `chinese:"是否只在空闲时间发通知"`
	NotifyNewTopicByEmail          string `chinese:"是否接收新主题邮件通知"`
	NotifyCommentNewCommentByEmail string `chinese:"是否接收评论的新评论邮件通知"`
	NotifyCommentNewCommentByPush  string `chinese:"是否接收评论的新评论推送通知"`
	NotifyReplyAcceptedByEmail     string `chinese:"是否接收答案被采纳邮件通知"`
	NotifyReplyAcceptedByPush      string `chinese:"是否接收答案被采纳推送通知"`
	NotifyReplyNewCommentByEmail   string `chinese:"是否接收答案的新评论邮件通知"`
	NotifyReplyNewCommentByPush    string `chinese:"是否接收答案的新评论推送通知"`
	ReadableCreateTime             string `chinese:"创建时间" list:"true"`
	ReadableUpdateTime             string `chinese:"更新时间" list:"true"`
	ReviewStatus                   string `chinese:"审核状态" list:"true" code:"reviewStatus" list:"true"`
}

type Feedback

type Feedback struct {
	ID         string `chinese:"ID" list:"true"`
	AuthorName string `chinese:"姓名" list:"true"`
	Services   string `chinese:"希望提供的服务" list:"true"`
	Suggestion string `chinese:"建议" list:"true"`
}

type Recommendation

type Recommendation struct {
	ID       string `chinese:"ID" list:"true"`
	Name     string `chinese:"姓名" list:"true"`
	Position string `chinese:"职位" list:"true"`
	Photo    string `chinese:"照片" list:"true"`
	Words    string `chinese:"推荐语" list:"true"`
}

type Reply

type Reply struct {
	ID                 string `chinese:"ID" list:"true"`
	TopicID            string `chinese:"问题ID" list:"true"`
	TopicTitle         string `chinese:"问题标题" list:"true"`
	AuthorID           string `chinese:"答案作者ID" list:"true"`
	AuthorName         string `chinese:"答案作者姓名" list:"true"`
	Content            string `chinese:"内容" list:"true"`
	ReadableCreateTime string `chinese:"创建时间" list:"true"`
	ReadableUpdateTime string `chinese:"更新时间" list:"true"`
}

type Star

type Star struct {
	Date     string `chinese:"日期" list:"true"`
	Experts  string `chinese:"创业公司" list:"true"`
	Startups string `chinese:"专家" list:"true"`
}

type Startup

type Startup struct {
	ID                 string `chinese:"ID" list:"true"`
	Name               string `chinese:"名称" list:"true"`
	RegistrationName   string `chinese:"注册名称" list:"true"`
	Certificate        string `chinese:"证书"`
	City               string `chinese:"城市" code:"city" list:"true"`
	ConsumeCtoCoins    string `chinese:"消耗的悬赏分"`
	CoverImage         string `chinese:"封面图片"`
	CoverTitle         string `chinese:"封面标题"`
	CtoCoins           string `chinese:"可用的悬赏分"`
	Description        string `chinese:"介绍"`
	Domain             string `chinese:"领域" code:"domain" list:"true"`
	Founders           string `chinese:"创始人" list:"true"`
	HelpedExperts      string `chinese:"帮助该企业过的专家"`
	Homepage           string `chinese:"主页" list:"true"`
	RunningStatus      string `chinese:"运营状态" code:"runningStatus" list:"true"`
	InvestmentStatus   string `chinese:"融资状态" code:"investmentStatus" list:"true"`
	Investors          string `chinese:"投资人" list:"true"`
	Products           string `chinese:"产品"`
	ResolvedTopicCount string `chinese:"被解答的问题数"`
	ReviewStatus       string `chinese:"审核状态" code:"reviewStatus" list:"true"`
	StaffNumber        string `chinese:"员工人数" code:"staffNumber"`
	StartYear          string `chinese:"成立年份"`
	StartMonth         string `chinese:"成立月份"`
	TopicCount         string `chinese:"提出的问题总数"`
	ViewCount          string `chinese:"被浏览次数"`
	ReadableCreateTime string `chinese:"创建时间" list:"true"`
	ReadableUpdateTime string `chinese:"更新时间" list:"true"`
}

type Topic

type Topic struct {
	ID                 string `chinese:"ID" list:"true"`
	Title              string `chinese:"标题" list:"true"`
	Summary            string `chinese:"摘要" list:"true"`
	Content            string `chinese:"内容"`
	Category           string `chinese:"类别" list:"true" code:"category"`
	CtoCoins           string `chinese:"悬赏分" list:"true"`
	Tags               string `chinese:"标签"`
	StartupName        string `chinese:"创业公司" list:"true"`
	AuthorName         string `chinese:"创业公司员工" list:"true"`
	ReplyCount         string `chinese:"回复数" list:"true"`
	ResolvedComment    string `chinese:"采纳评论"`
	ResolvedReplyID    string `chinese:"采纳回复ID" list:"true"`
	ReadableCreateTime string `chinese:"创建时间" list:"true"`
	ReadableUpdateTime string `chinese:"更新时间" list:"true"`
	Status             string `chinese:"问题状态" list:"true" code:"postStatus"`
}

Jump to

Keyboard shortcuts

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