Преглед изворни кода

ft: 初始化提交

master
SisMaker пре 3 година
комит
ebe26c18da
11 измењених фајлова са 172 додато и 0 уклоњено
  1. +29
    -0
      .gitignore
  2. +21
    -0
      LICENSE
  3. +9
    -0
      README.md
  4. +7
    -0
      include/ranks.hrl
  5. +10
    -0
      rebar.config
  6. +5
    -0
      src/rank/rankMgr.erl
  7. +5
    -0
      src/rank/rankWork.erl
  8. +12
    -0
      src/ranks.app.src
  9. +33
    -0
      src/ranks.erl
  10. +11
    -0
      src/ranks_app.erl
  11. +30
    -0
      src/ranks_sup.erl

+ 29
- 0
.gitignore Прегледај датотеку

@ -0,0 +1,29 @@
.eunit
*.o
*.beam
*.plt
erl_crash.dump
.concrete/DEV_MODE
# rebar 2.x
.rebar
rel/example_project
ebin/*
deps
# rebar 3
.rebar3
_build/
_checkouts/
rebar.lock
# idea
.idea
*.iml
cmake-build*
CMakeLists.txt
# nif compile temp file
*.pdb
*.d
compile_commands.json

+ 21
- 0
LICENSE Прегледај датотеку

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 AICells
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

+ 9
- 0
README.md Прегледај датотеку

@ -0,0 +1,9 @@
ranks
=====
排行榜
Build
-----
$ rebar3 compile

+ 7
- 0
include/ranks.hrl Прегледај датотеку

@ -0,0 +1,7 @@
-ifndef(RANKS_H_).
-define(RANKS_H_, true).
-endif.

+ 10
- 0
rebar.config Прегледај датотеку

@ -0,0 +1,10 @@
{erl_opts, [no_debug_info, {i, "include"}]}.
{deps, [
{eGbh, ".*", {git, "http://sismaker.tpddns.cn:53000/SisMaker/eGbh.git", {branch, "master"}}},
{eSync, ".*", {git, "http://sismaker.tpddns.cn:53000/SisMaker/eSync.git", {branch, "master"}}}
]}.
{shell, [
% {config, "config/sys.config"},
{apps, [ranks]}
]}.

+ 5
- 0
src/rank/rankMgr.erl Прегледај датотеку

@ -0,0 +1,5 @@
-module(rankMgr).
-behavior(gen_srv).
-export([]).

+ 5
- 0
src/rank/rankWork.erl Прегледај датотеку

@ -0,0 +1,5 @@
-module(rankWork).
-behavior(gen_srv).
-export([]).

+ 12
- 0
src/ranks.app.src Прегледај датотеку

@ -0,0 +1,12 @@
{application, ranks,
[{description, "An OTP application"},
{vsn, "0.1.0"},
{registered, []},
{mod, {ranks_app, []}},
{applications, [kernel, stdlib]},
{env,[]},
{modules, []},
{licenses, ["MIT"]},
{links, []}
]}.

+ 33
- 0
src/ranks.erl Прегледај датотеку

@ -0,0 +1,33 @@
-module(ranks).
-export([
start/0
, stop/0
,
, initRank/1 %%
, updateScore/3 %%
, updateInfo/2 %%
, getRankInfo/3 %%
]).
start() ->
application:ensure_all_started(ranks).
stop() ->
application:stop(ranks).
startWork(Cnt) ->
ok.
initRank(RankType) ->
ok.
updateScore(RankType, Key, Score) ->
ok.
updateInfo(Key, Infos) ->
ok.
getRankInfo(RankType, Cnt, PageInfo) ->
ok.

+ 11
- 0
src/ranks_app.erl Прегледај датотеку

@ -0,0 +1,11 @@
-module(ranks_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
ranks_sup:start_link().
stop(_State) ->
ok.

+ 30
- 0
src/ranks_sup.erl Прегледај датотеку

@ -0,0 +1,30 @@
-module(ranks_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
%% sup_flags() = #{strategy => strategy(), % optional
%% intensity => non_neg_integer(), % optional
%% period => pos_integer()} % optional
%% child_spec() = #{id => child_id(), % mandatory
%% start => mfargs(), % mandatory
%% restart => restart(), % optional
%% shutdown => shutdown(), % optional
%% type => worker(), % optional
%% modules => modules()} % optional
init([]) ->
SupFlags = #{strategy => one_for_all,
intensity => 0,
period => 1},
ChildSpecs = [],
{ok, {SupFlags, ChildSpecs}}.
%% internal functions

Loading…
Откажи
Сачувај