Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: Add stub interactor api and controller #39

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

atlas-comstock
Copy link

@atlas-comstock atlas-comstock commented Jan 20, 2022

Implement issue #38

@atlas-comstock
Copy link
Author

$ curl localhost:4000/tai_shang_world_generator/api/v1/interact
{"error_code":0,"error_msg":"success","result":{}}%
$ http post localhost:4000/tai_shang_world_generator/api/v1/interact  signature="" payload="payload"

HTTP/1.1 200 OK
access-control-allow-credentials: true
access-control-allow-origin:
access-control-expose-headers:
cache-control: max-age=0, private, must-revalidate
content-length: 50
content-type: application/json; charset=utf-8
date: Thu, 20 Jan 2022 16:06:54 GMT
server: Cowboy
vary: Origin
x-request-id: FswGOwjFF9a7CEoAAAHG

{
    "error_code": 0,
    "error_msg": "success",
    "result": {}
}


use TaiShangWorldGeneratorWeb, :controller

def interact_first_time(conn, _params) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path中的参数也模式匹配上吧。

json(conn, ResponseMod.get_res(%{}, :ok))
end

def interact_second_time(conn, %{"signature" => signature, "payload" => payload} = params) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与上同理

@leeduckgo leeduckgo merged commit cf24415 into NonceGeek:main Jan 21, 2022
@atlas-comstock atlas-comstock deleted the add-interact-stub-api branch January 21, 2022 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Elixir] 两个新的接口,用于「地图上的角色」和「地图上的Objects」交互用
3 participants