-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from eDoctor/T318_meeting_go_sdk
feat:sdk add api
- Loading branch information
Showing
18 changed files
with
634 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package live_form | ||
|
||
import ( | ||
"encoding/json" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
) | ||
|
||
type BindFormRequest struct { | ||
bRequest *request.BaseRequest | ||
FormId uint64 `json:"form_id"` | ||
RoomId uint64 `json:"room_id"` | ||
CollectionRule uint8 `json:"collection_rule,omitempty"` | ||
} | ||
|
||
func NewLiveBindFormRequest() *BindFormRequest { | ||
r := new(BindFormRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = constants.LiveBindFormRequestUri | ||
return r | ||
} | ||
|
||
func (r *BindFormRequest) SetApiVersion(apiVersion string) *BindFormRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *BindFormRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
r.bRequest.Client = client | ||
registerByte, _ := json.Marshal(r) | ||
return r.bRequest.HttpPost(registerByte) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package live_speaker | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
) | ||
|
||
type CreateRequest struct { | ||
bRequest *request.BaseRequest | ||
Speakers []map[string]interface{} `json:"speakers"` | ||
} | ||
|
||
func NewSpeakerCreateRequest(roomId int64) *CreateRequest { | ||
r := new(CreateRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveSpeakerCreateRequestUri, roomId) | ||
return r | ||
} | ||
|
||
func (r *CreateRequest) SetApiVersion(apiVersion string) *CreateRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *CreateRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
r.bRequest.Client = client | ||
registerByte, _ := json.Marshal(r) | ||
return r.bRequest.HttpPost(registerByte) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package live_speaker | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
) | ||
|
||
type DeleteRequest struct { | ||
bRequest *request.BaseRequest | ||
} | ||
|
||
func NewSpeakerDeleteRequest(roomId int64, id int64) *DeleteRequest { | ||
r := new(DeleteRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveSpeakerDeleteRequestUri, roomId, id) | ||
return r | ||
} | ||
|
||
func (r *DeleteRequest) SetApiVersion(apiVersion string) *DeleteRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *DeleteRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
r.bRequest.Client = client | ||
registerByte, _ := json.Marshal(r) | ||
return r.bRequest.HttpDelete(registerByte) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package live_speaker | ||
|
||
import ( | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
) | ||
|
||
type DetailRequest struct { | ||
bRequest *request.BaseRequest | ||
} | ||
|
||
func NewSpeakerDetailRequest(roomId int64, id int64) *DetailRequest { | ||
r := new(DetailRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveSpeakerDetailRequestUri, roomId, id) | ||
return r | ||
} | ||
|
||
func (r *DetailRequest) SetApiVersion(apiVersion string) *DetailRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *DetailRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
r.bRequest.Client = client | ||
//registerByte, _ := json.Marshal(r) | ||
return r.bRequest.HttpGet("") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package live_speaker | ||
|
||
import ( | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
"net/url" | ||
) | ||
|
||
type ListRequest struct { | ||
bRequest *request.BaseRequest | ||
Page uint64 | ||
PageSize uint64 | ||
} | ||
|
||
func NewSpeakerListRequest(roomId int64) *ListRequest { | ||
r := new(ListRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveSpeakerListRequestUri, roomId) | ||
return r | ||
} | ||
|
||
func (r *ListRequest) SetApiVersion(apiVersion string) *ListRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *ListRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
|
||
r.bRequest.Client = client | ||
|
||
queryStringStruct := url.Values{} | ||
if r.Page > 0 { | ||
queryStringStruct.Set("page", fmt.Sprintf("%d", r.Page)) | ||
} | ||
|
||
if r.PageSize > 0 { | ||
queryStringStruct.Set("page_size", fmt.Sprintf("%d", r.PageSize)) | ||
} | ||
|
||
queryStr := queryStringStruct.Encode() | ||
resResponse := r.bRequest.HttpGet(queryStr) | ||
|
||
return resResponse | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package live_speaker | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
) | ||
|
||
type UpdateRequest struct { | ||
bRequest *request.BaseRequest | ||
Id uint64 `json:"id"` | ||
SpeakerPassword string `json:"speaker_password"` | ||
} | ||
|
||
func NewSpeakerUpdateRequest(roomId int64, id int64) *UpdateRequest { | ||
r := new(UpdateRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveSpeakerUpdateRequestUri, roomId, id) | ||
return r | ||
} | ||
|
||
func (r *UpdateRequest) SetApiVersion(apiVersion string) *UpdateRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *UpdateRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
r.bRequest.Client = client | ||
registerByte, _ := json.Marshal(r) | ||
return r.bRequest.HttpPost(registerByte) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package live_white | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
) | ||
|
||
type DeleteRequest struct { | ||
bRequest *request.BaseRequest | ||
Type int8 `json:"type"` | ||
All int8 `json:"all"` | ||
Content string `json:"content,omitempty"` | ||
} | ||
|
||
func NewWhiteDeleteRequest(roomId int64) *DeleteRequest { | ||
r := new(DeleteRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveWhiteDeleteRequestUri, roomId) | ||
return r | ||
} | ||
|
||
func (r *DeleteRequest) SetApiVersion(apiVersion string) *DeleteRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *DeleteRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
r.bRequest.Client = client | ||
registerByte, _ := json.Marshal(r) | ||
return r.bRequest.HttpDelete(registerByte) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package live_white | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
) | ||
|
||
type CreateRequest struct { | ||
bRequest *request.BaseRequest | ||
Type int8 `json:"type"` | ||
Content string `json:"content"` | ||
} | ||
|
||
func NewWhiteCreateRequest(roomId int64) *CreateRequest { | ||
r := new(CreateRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveWhiteCreateRequestUri, roomId) | ||
return r | ||
} | ||
|
||
func (r *CreateRequest) SetApiVersion(apiVersion string) *CreateRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *CreateRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
r.bRequest.Client = client | ||
registerByte, _ := json.Marshal(r) | ||
return r.bRequest.HttpPost(registerByte) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package live_white | ||
|
||
import ( | ||
"fmt" | ||
meeting "github.com/eDoctor/talkmed-meeting-open-sdk-golang" | ||
"github.com/eDoctor/talkmed-meeting-open-sdk-golang/request" | ||
constants "github.com/eDoctor/talkmed-meeting-open-sdk-golang/tools/constant" | ||
"net/url" | ||
) | ||
|
||
type ListRequest struct { | ||
bRequest *request.BaseRequest | ||
Page uint64 `json:"page"` | ||
PageSize uint64 `json:"page_size"` | ||
Type uint64 `json:"type,omitempty"` | ||
Content string `json:"content,omitempty"` | ||
IsUsed uint8 `json:"is_used,omitempty"` | ||
} | ||
|
||
func NewWhiteListRequest(roomId int64) *ListRequest { | ||
r := new(ListRequest) | ||
br := new(request.BaseRequest) | ||
r.bRequest = br | ||
r.bRequest.ApiVersion = constants.ApiV1 | ||
r.bRequest.ApiRequestUri = fmt.Sprintf(constants.LiveWhiteListRequestUri, roomId) | ||
return r | ||
} | ||
|
||
func (r *ListRequest) SetApiVersion(apiVersion string) *ListRequest { | ||
r.bRequest.ApiVersion = apiVersion | ||
return r | ||
} | ||
|
||
func (r *ListRequest) Request(client *meeting.MeetClient) request.ApiResponse { | ||
|
||
r.bRequest.Client = client | ||
|
||
queryStringStruct := url.Values{} | ||
if r.Page > 0 { | ||
queryStringStruct.Set("page", fmt.Sprintf("%d", r.Page)) | ||
} | ||
|
||
if r.PageSize > 0 { | ||
queryStringStruct.Set("page_size", fmt.Sprintf("%d", r.PageSize)) | ||
} | ||
|
||
if r.Type > 0 { | ||
queryStringStruct.Set("type", fmt.Sprintf("%d", r.Type)) | ||
} | ||
|
||
if r.IsUsed > 0 { | ||
queryStringStruct.Set("is_used", fmt.Sprintf("%d", r.IsUsed)) | ||
} | ||
|
||
if r.Content != "" { | ||
queryStringStruct.Set("content", fmt.Sprintf("%s", r.Content)) | ||
} | ||
|
||
queryStr := queryStringStruct.Encode() | ||
resResponse := r.bRequest.HttpGet(queryStr) | ||
|
||
return resResponse | ||
} |
Oops, something went wrong.