api

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CORP_API_TYPE = map[string][]string{
	"GET_ACCESS_TOKEN":  {"/cgi-bin/gettoken", "GET"},
	"USER_CREATE":       {"/cgi-bin/user/create?access_token=ACCESS_TOKEN", "POST"},
	"USER_GET":          {"/cgi-bin/user/get?access_token=ACCESS_TOKEN", "GET"},
	"USER_UPDATE":       {"/cgi-bin/user/update?access_token=ACCESS_TOKEN", "POST"},
	"USER_DELETE":       {"/cgi-bin/user/delete?access_token=ACCESS_TOKEN", "GET"},
	"USER_BATCH_DELETE": {"/cgi-bin/user/batchdelete?access_token=ACCESS_TOKEN", "POST"},
	"USER_SIMPLE_LIST ": {"/cgi-bin/user/simplelist?access_token=ACCESS_TOKEN", "GET"},
	"USER_LIST":         {"/cgi-bin/user/list?access_token=ACCESS_TOKEN", "GET"},
	"USERID_TO_OPENID":  {"/cgi-bin/user/convert_to_openid?access_token=ACCESS_TOKEN", "POST"},
	"OPENID_TO_USERID":  {"/cgi-bin/user/convert_to_userid?access_token=ACCESS_TOKEN", "POST"},
	"USER_AUTH_SUCCESS": {"/cgi-bin/user/authsucc?access_token=ACCESS_TOKEN", "GET"},

	"DEPARTMENT_CREATE": {"/cgi-bin/department/create?access_token=ACCESS_TOKEN", "POST"},
	"DEPARTMENT_UPDATE": {"/cgi-bin/department/update?access_token=ACCESS_TOKEN", "POST"},
	"DEPARTMENT_DELETE": {"/cgi-bin/department/delete?access_token=ACCESS_TOKEN", "GET"},
	"DEPARTMENT_LIST":   {"/cgi-bin/department/list?access_token=ACCESS_TOKEN", "GET"},

	"TAG_CREATE":      {"/cgi-bin/tag/create?access_token=ACCESS_TOKEN", "POST"},
	"TAG_UPDATE":      {"/cgi-bin/tag/update?access_token=ACCESS_TOKEN", "POST"},
	"TAG_DELETE":      {"/cgi-bin/tag/delete?access_token=ACCESS_TOKEN", "GET"},
	"TAG_GET_USER":    {"/cgi-bin/tag/get?access_token=ACCESS_TOKEN", "GET"},
	"TAG_ADD_USER":    {"/cgi-bin/tag/addtagusers?access_token=ACCESS_TOKEN", "POST"},
	"TAG_DELETE_USER": {"/cgi-bin/tag/deltagusers?access_token=ACCESS_TOKEN", "POST"},
	"TAG_GET_LIST":    {"/cgi-bin/tag/list?access_token=ACCESS_TOKEN", "GET"},

	"BATCH_JOB_GET_RESULT": {"/cgi-bin/batch/getresult?access_token=ACCESS_TOKEN", "GET"},

	"BATCH_INVITE": {"/cgi-bin/batch/invite?access_token=ACCESS_TOKEN", "POST"},

	"AGENT_GET":      {"/cgi-bin/agent/get?access_token=ACCESS_TOKEN", "GET"},
	"AGENT_SET":      {"/cgi-bin/agent/set?access_token=ACCESS_TOKEN", "POST"},
	"AGENT_GET_LIST": {"/cgi-bin/agent/list?access_token=ACCESS_TOKEN", "GET"},

	"MENU_CREATE": {"/cgi-bin/menu/create?access_token=ACCESS_TOKEN", "POST"},
	"MENU_GET":    {"/cgi-bin/menu/get?access_token=ACCESS_TOKEN", "GET"},
	"MENU_DELETE": {"/cgi-bin/menu/delete?access_token=ACCESS_TOKEN", "GET"},

	"MESSAGE_SEND": {"/cgi-bin/message/send?access_token=ACCESS_TOKEN", "POST"},

	"MEDIA_GET": {"/cgi-bin/media/get?access_token=ACCESS_TOKEN", "GET"},

	"GET_USER_INFO_BY_CODE": {"/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN", "GET"},
	"GET_USER_DETAIL":       {"/cgi-bin/user/getuserdetail?access_token=ACCESS_TOKEN", "POST"},

	"GET_TICKET":       {"/cgi-bin/ticket/get?access_token=ACCESS_TOKEN", "GET"},
	"GET_JSAPI_TICKET": {"/cgi-bin/get_jsapi_ticket?access_token=ACCESS_TOKEN", "GET"},

	"GET_CHECKIN_OPTION":  {"/cgi-bin/checkin/getcheckinoption?access_token=ACCESS_TOKEN", "POST"},
	"GET_CHECKIN_DATA":    {"/cgi-bin/checkin/getcheckindata?access_token=ACCESS_TOKEN", "POST"},
	"GET_APPROVAL_DETAIL": {"/cgi-bin/oa/getapprovaldetail?access_token=ACCESS_TOKEN", "POST"},

	"GET_INVOICE_INFO":            {"/cgi-bin/card/invoice/reimburse/getinvoiceinfo?access_token=ACCESS_TOKEN", "POST"},
	"UPDATE_INVOICE_STATUS":       {"/cgi-bin/card/invoice/reimburse/updateinvoicestatus?access_token=ACCESS_TOKEN", "POST"},
	"BATCH_UPDATE_INVOICE_STATUS": {"/cgi-bin/card/invoice/reimburse/updatestatusbatch?access_token=ACCESS_TOKEN", "POST"},
	"BATCH_GET_INVOICE_INFO":      {"/cgi-bin/card/invoice/reimburse/getinvoiceinfobatch?access_token=ACCESS_TOKEN", "POST"},
}
View Source
var SERVICE_CORP_API_TYPE = map[string][]string{
	"GET_CORP_TOKEN":         {"/cgi-bin/service/get_corp_token?suite_access_token=SUITE_ACCESS_TOKEN", "POST"},
	"GET_SUITE_TOKEN":        {"/cgi-bin/service/get_suite_token", "POST"},
	"GET_PRE_AUTH_CODE":      {"/cgi-bin/service/get_pre_auth_code?suite_access_token=SUITE_ACCESS_TOKEN", "GET"},
	"SET_SESSION_INFO":       {"/cgi-bin/service/set_session_info?suite_access_token=SUITE_ACCESS_TOKEN", "POST"},
	"GET_PERMANENT_CODE":     {"/cgi-bin/service/get_permanent_code?suite_access_token=SUITE_ACCESS_TOKEN", "POST"},
	"GET_AUTH_INFO":          {"/cgi-bin/service/get_auth_info?suite_access_token=SUITE_ACCESS_TOKEN", "POST"},
	"GET_ADMIN_LIST":         {"/cgi-bin/service/get_admin_list?suite_access_token=SUITE_ACCESS_TOKEN", "POST"},
	"GET_USER_INFO_BY_3RD":   {"/cgi-bin/service/getuserinfo3rd?suite_access_token=SUITE_ACCESS_TOKEN", "GET"},
	"GET_USER_DETAIL_BY_3RD": {"/cgi-bin/service/getuserdetail3rd?suite_access_token=SUITE_ACCESS_TOKEN", "POST"},
}
View Source
var SERVICE_PROVIDER_API_TYPE = map[string][]string{
	"GET_PROVIDER_TOKEN":       {"/cgi-bin/service/get_provider_token", "POST"},
	"GET_LOGIN_INFO":           {"/cgi-bin/service/get_login_info?access_token=PROVIDER_ACCESS_TOKEN", "POST"},
	"GET_REGISTER_CODE":        {"/cgi-bin/service/get_register_code?provider_access_token=PROVIDER_ACCESS_TOKEN", "POST"},
	"GET_REGISTER_INFO":        {"/cgi-bin/service/get_register_info?provider_access_token=PROVIDER_ACCESS_TOKEN", "POST"},
	"SET_AGENT_SCOPE":          {"/cgi-bin/agent/set_scope", "POST"},
	"SET_CONTACT_SYNC_SUCCESS": {"/cgi-bin/sync/contact_sync_success", "GET"},
}

Functions

This section is empty.

Types

type API

func (*API) HttpCall

func (a *API) HttpCall(urlType []string, args map[string]interface{}) (map[string]interface{}, error)

func (*API) HttpGetRespPlus added in v1.0.5

func (a *API) HttpGetRespPlus(urlType []string, args map[string]interface{}) ([]byte, error)

type AccessAPI

type AccessAPI interface {
	GetAccessToken() string
	RefreshAccessToken()
}

type CorpAPI

type CorpAPI struct {
	API
	CorpId      string
	Secret      string
	AccessToken string
	// contains filtered or unexported fields
}

func NewCorpAPI

func NewCorpAPI(corpId, secret string) *CorpAPI

func (*CorpAPI) AgentGet

func (c *CorpAPI) AgentGet(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) AgentGetList

func (c *CorpAPI) AgentGetList(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) AgentSet

func (c *CorpAPI) AgentSet(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) BatchGetInvoiceInfo

func (c *CorpAPI) BatchGetInvoiceInfo(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) BatchInvite

func (c *CorpAPI) BatchInvite(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) BatchJobGetResult

func (c *CorpAPI) BatchJobGetResult(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) BatchUpdateInvoiceStatus

func (c *CorpAPI) BatchUpdateInvoiceStatus(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) DepartmentCreate

func (c *CorpAPI) DepartmentCreate(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) DepartmentDelete

func (c *CorpAPI) DepartmentDelete(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) DepartmentList

func (c *CorpAPI) DepartmentList(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) DepartmentUpdate

func (c *CorpAPI) DepartmentUpdate(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetAccessToken

func (c *CorpAPI) GetAccessToken() string

func (*CorpAPI) GetApprovalDetail

func (c *CorpAPI) GetApprovalDetail(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetCheckinData

func (c *CorpAPI) GetCheckinData(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetCheckinOption

func (c *CorpAPI) GetCheckinOption(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetInvoiceInfo

func (c *CorpAPI) GetInvoiceInfo(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetJsapiTicket

func (c *CorpAPI) GetJsapiTicket(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetTicket

func (c *CorpAPI) GetTicket(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetUserDetail

func (c *CorpAPI) GetUserDetail(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) GetUserInfoByCode

func (c *CorpAPI) GetUserInfoByCode(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) MediaGet

func (c *CorpAPI) MediaGet(args map[string]interface{}) ([]byte, error)

func (*CorpAPI) MenuCreate

func (c *CorpAPI) MenuCreate(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) MenuDelete

func (c *CorpAPI) MenuDelete(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) MenuGet

func (c *CorpAPI) MenuGet(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) MessageSend

func (c *CorpAPI) MessageSend(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) OpenidToUserid

func (c *CorpAPI) OpenidToUserid(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) RefreshAccessToken

func (c *CorpAPI) RefreshAccessToken()

func (*CorpAPI) TagAddUser

func (c *CorpAPI) TagAddUser(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) TagCreate

func (c *CorpAPI) TagCreate(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) TagDelete

func (c *CorpAPI) TagDelete(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) TagDeleteUser

func (c *CorpAPI) TagDeleteUser(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) TagGetList

func (c *CorpAPI) TagGetList(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) TagGetUser

func (c *CorpAPI) TagGetUser(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) TagUpdate

func (c *CorpAPI) TagUpdate(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UpdateInvoiceStatus

func (c *CorpAPI) UpdateInvoiceStatus(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserAuthSuccess

func (c *CorpAPI) UserAuthSuccess(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserBatchDelete

func (c *CorpAPI) UserBatchDelete(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserCreate

func (c *CorpAPI) UserCreate(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserDelete

func (c *CorpAPI) UserDelete(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserGet

func (c *CorpAPI) UserGet(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserList

func (c *CorpAPI) UserList(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserSimpleList

func (c *CorpAPI) UserSimpleList(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UserUpdate

func (c *CorpAPI) UserUpdate(args map[string]interface{}) (map[string]interface{}, error)

func (*CorpAPI) UseridToOpenid

func (c *CorpAPI) UseridToOpenid(args map[string]interface{}) (map[string]interface{}, error)

type ProviderAccessAPI

type ProviderAccessAPI interface {
	GetProviderAccessToken() string
	RefreshProviderAccessToken()
}

type ServiceCorpAPI

type ServiceCorpAPI struct {
}

ServiceCorpAPI TODO

type ServiceProviderApi

type ServiceProviderApi struct {
}

ServiceProviderApi TODO

type SuiteAccessAPI

type SuiteAccessAPI interface {
	GetSuiteAccessToken() string
	RefreshSuiteAccessToken()
}

Jump to

Keyboard shortcuts

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