本文整理汇总了Golang中github.com/mattermost/platform/model.Client.CreateTeam方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.CreateTeam方法的具体用法?Golang Client.CreateTeam怎么用?Golang Client.CreateTeam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/mattermost/platform/model.Client
的用法示例。
在下文中一共展示了Client.CreateTeam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CreateTeam
func (me *TestHelper) CreateTeam(client *model.Client) *model.Team {
id := model.NewId()
team := &model.Team{
DisplayName: "dn_" + id,
Name: "name" + id,
Email: "success+" + id + "@simulator.amazonses.com",
Type: model.TEAM_OPEN,
}
utils.DisableDebugLogForTest()
r := client.Must(client.CreateTeam(team)).Data.(*model.Team)
utils.EnableDebugLogForTest()
return r
}
示例2: CreateBasicUser
// Basic test team and user so you always know one
func CreateBasicUser(client *model.Client) *model.AppError {
result, _ := client.FindTeamByName(BTEST_TEAM_NAME, true)
if result.Data.(bool) == false {
newteam := &model.Team{DisplayName: BTEST_TEAM_DISPLAY_NAME, Name: BTEST_TEAM_NAME, Email: BTEST_TEAM_EMAIL, Type: BTEST_TEAM_TYPE}
result, err := client.CreateTeam(newteam)
if err != nil {
return err
}
basicteam := result.Data.(*model.Team)
newuser := &model.User{TeamId: basicteam.Id, Email: BTEST_USER_EMAIL, Nickname: BTEST_USER_NAME, Password: BTEST_USER_PASSWORD}
result, err = client.CreateUser(newuser, "")
if err != nil {
return err
}
store.Must(Srv.Store.User().VerifyEmail(result.Data.(*model.User).Id))
}
return nil
}