小编goo*_*nsu的帖子

如何在定义中重用swagger定义?

代码如下:

definitions:
  Result:
    type: object
    properties:
      code:
        type: integer
        format: int32
      message:
        type: string
  FindUID:
    type: object
    properties:
      code:
        type: integer
        format: int32
      message:
        type: string
      data:
        type: object
        properties:
          uid:
            type: integer
            format: int64
  FindUsername:
    type: object
    properties:
      code:
        type: integer
        format: int32
      message:
        type: string
      data:
        type: object
        properties:
          username:
            type: string
Run Code Online (Sandbox Code Playgroud)

正如你所看到的,第一部分FindUIDFindUsername是一样的Result.如何用这些重复的代码替换Result

swagger

3
推荐指数
1
解决办法
815
查看次数

如何从An Erlang Pid中获取每个部分?

pid(A, B, C)可以生成一个pid <A.B.C>,我如何从pid中获取A,B和C?

erlang pid

2
推荐指数
1
解决办法
136
查看次数

如何自动对齐以下代码?

get_base_exp(PlayerLv)->
    case PlayerLv of
        1->30;
        2->30;
        3->60;
        4->100;
        5->160;
        6->240;
        7->330;
        8->440;
        9->570;
        10->710;
        11->880;
        12->1060
    end.
Run Code Online (Sandbox Code Playgroud)

以下内容:

get_base_exp(PlayerLv)->
    case PlayerLv of
        1  -> 30;
        2  -> 30;
        3  -> 60;
        4  -> 100;
        5  -> 160;
        6  -> 240;
        7  -> 330;
        8  -> 440;
        9  -> 570;
        10 -> 710;
        11 -> 880;
        12 -> 1060
    end.
Run Code Online (Sandbox Code Playgroud)

emacs

2
推荐指数
2
解决办法
575
查看次数

关于erlang的一点困惑:现在/ 0手册

返回元组{MegaSecs,Secs,MicroSecs},它是自格林威治标准时间1970年1月1日00:00(零小时)起经过的时间,假设底层操作系统支持此操作.否则,选择其他一些时间点.还保证随后对此BIF的调用会不断返回增加的值.因此,now()的返回值可用于生成唯一的时间戳,如果在快速机器上的紧密循环中调用它,则节点的时间可能会变得偏斜.

粗体句意味着什么?我有点困惑,因为我的英语不是很好:)是否意味着时间线以45度上升或者是否意味着如果erlang:now/0经常调用节点的性能会降低?

非常感谢你.

erlang

1
推荐指数
1
解决办法
269
查看次数

标签 统计

erlang ×2

emacs ×1

pid ×1

swagger ×1