@@ -10,103 +10,101 @@ pub mod issues;
1010mod explore;
1111
1212pub fn v1_route ( config : & mut actix_web:: web:: ServiceConfig ) {
13- config. service (
14- scope ( "/v1" )
15- . route ( "" , get ( ) . to ( v1_hello) )
16- . route ( "/explore" , get ( ) . to ( explore:: explore) )
17- . route ( "/check/{name}" , get ( ) . to ( utils:: check_name:: check_name) )
18- . service (
19- scope ( "/merge" ) . route ( "/users/{username}" , get ( ) . to ( merge:: users:: merge_users) ) ,
20- )
21- . service (
22- scope ( "/users" )
23- . route ( "/sigck" , post ( ) . to ( users:: sigops:: sigin_check_by_username) )
24- . route ( "/sigin" , post ( ) . to ( users:: sigops:: sigin) ) // must captcha
25- . route ( "/sigup" , post ( ) . to ( users:: sigops:: sigup) ) // must captcha
26- . route ( "/sigout" , post ( ) . to ( users:: sigops:: sigout) )
27- . route ( "/check" , get ( ) . to ( users:: sigops:: sigin_check) )
28- . route ( "/profile" , post ( ) . to ( users:: profile:: update_profile:: update_profile) )
29- . route ( "/profile" , get ( ) . to ( users:: profile:: get_profile:: get_profile) )
30- . route ( "/orgs" , post ( ) . to ( org:: member:: list:: org_owner_list) )
31- . route ( "/passwd" , post ( ) . to ( users:: passwd:: update_password:: update_password) )
32- . route ( "/ssh_key" , post ( ) . to ( users:: ssh_key:: create_owner_ssh_token) )
33- . route ( "/ssh_key" , get ( ) . to ( users:: ssh_key:: list_owner_ssh_key) )
34- . route ( "/ssh_key/{uid}" , delete ( ) . to ( users:: ssh_key:: delete_owner_ssh_token) )
35- . route ( "/token" , post ( ) . to ( users:: token:: create_owner_token) )
36- . route ( "/token" , get ( ) . to ( users:: token:: list_owner_token) )
37- . route ( "/token" , delete ( ) . to ( users:: token:: delete_owner_token) )
38- . service (
39- scope ( "/{owner}" )
40- . route ( "/repo" , post ( ) . to ( repo:: list:: repo_user_list) )
41- . route ( "/orgs" , post ( ) . to ( org:: member:: list:: org_user_list) )
42- )
43- )
44- . service (
45- scope ( "/context" )
46- . route ( "/current" , get ( ) . to ( users:: context:: current_context) )
47- . route ( "/list" , get ( ) . to ( users:: context:: list_context) )
48- . route ( "/switch/{uid}" , post ( ) . to ( users:: context:: switch_context) ) ,
49- )
50- . service (
51- scope ( "/utils" )
52- . route ( "/base64_captcha" , get ( ) . to ( utils:: base64_captcha:: utils_captcha) )
53- . route ( "/email_captcha_send" , post ( ) . to ( utils:: email_captcha:: email_captcha) )
54- . route ( "/email_captcha_check" , post ( ) . to ( utils:: email_captcha:: email_captcha_check) ) ,
55- )
56- . service (
57- scope ( "/repo" )
58- . route ( "" , post ( ) . to ( repo:: init:: repo_init) )
59- . route ( "/access" , post ( ) . to ( repo:: init:: repo_access) )
60- . service (
61- scope ( "/{owner}/{repo}" )
62- . route ( "" , post ( ) . to ( repo:: info:: repo_info) )
63- . route ( "/blob" , post ( ) . to ( repo:: fsops:: blob:: repo_blob) )
64- . route ( "/star" , post ( ) . to ( repo:: soc:: star:: repo_star) )
65- . route ( "/watch" , post ( ) . to ( repo:: soc:: watch:: repo_watch) )
66- . route ( "/can_setting" , get ( ) . to ( repo:: info:: repo_can_setting) )
67- . service (
68- scope ( "/branch" )
69- . route ( "/list" , get ( ) . to ( repo:: fsops:: branch:: list_branch) )
70- . route ( "/create" , post ( ) . to ( repo:: fsops:: branch:: create_branch) )
71- . route (
72- "/delete/{name}" ,
73- post ( ) . to ( repo:: fsops:: branch:: delete_branch) ,
74- )
75- . route (
76- "/rename/{name}/{new_name}" ,
77- post ( ) . to ( repo:: fsops:: branch:: rename_branch) ,
78- )
79- . route (
80- "/checkout/{name}" ,
81- post ( ) . to ( repo:: fsops:: branch:: checkout_head) ,
82- ) ,
83- )
84- . service (
85- scope ( "/tree" )
86- . route ( "/list" , post ( ) . to ( repo:: fsops:: tree:: repo_tree) )
87- . route (
88- "/message" ,
89- post ( ) . to ( repo:: fsops:: tree:: repo_tree_message) ,
90- ) ,
91- ) ,
92- ) ,
93- )
94- . service (
95- scope ( "/static" )
96- . route ( "/upload_avatar" , post ( ) . to ( rstatic:: avatar:: upload_avatar) )
97- . route ( "/img/{path}" , get ( ) . to ( rstatic:: avatar:: down_avatar) )
98- )
99- . service (
100- scope ( "/orgs" )
101- . route ( "" , post ( ) . to ( org:: create:: create_org) )
102- . service (
103- scope ( "/{org}" )
104- . route ( "" , get ( ) . to ( org:: info:: org_info) )
105- . route ( "/can_setting" , get ( ) . to ( org:: info:: org_can_setting) )
106- . route ( "/member" , post ( ) . to ( org:: member:: list:: org_member_list) )
107- )
108- )
109- ) ;
13+ config
14+ . route ( "" , get ( ) . to ( v1_hello) )
15+ . route ( "/explore" , get ( ) . to ( explore:: explore) )
16+ . route ( "/check/{name}" , get ( ) . to ( utils:: check_name:: check_name) )
17+ . service (
18+ scope ( "/merge" ) . route ( "/users/{username}" , get ( ) . to ( merge:: users:: merge_users) ) ,
19+ )
20+ . service (
21+ scope ( "/users" )
22+ . route ( "/sigck" , post ( ) . to ( users:: sigops:: sigin_check_by_username) )
23+ . route ( "/sigin" , post ( ) . to ( users:: sigops:: sigin) ) // must captcha
24+ . route ( "/sigup" , post ( ) . to ( users:: sigops:: sigup) ) // must captcha
25+ . route ( "/sigout" , post ( ) . to ( users:: sigops:: sigout) )
26+ . route ( "/check" , get ( ) . to ( users:: sigops:: sigin_check) )
27+ . route ( "/profile" , post ( ) . to ( users:: profile:: update_profile:: update_profile) )
28+ . route ( "/profile" , get ( ) . to ( users:: profile:: get_profile:: get_profile) )
29+ . route ( "/orgs" , post ( ) . to ( org:: member:: list:: org_owner_list) )
30+ . route ( "/passwd" , post ( ) . to ( users:: passwd:: update_password:: update_password) )
31+ . route ( "/ssh_key" , post ( ) . to ( users:: ssh_key:: create_owner_ssh_token) )
32+ . route ( "/ssh_key" , get ( ) . to ( users:: ssh_key:: list_owner_ssh_key) )
33+ . route ( "/ssh_key/{uid}" , delete ( ) . to ( users:: ssh_key:: delete_owner_ssh_token) )
34+ . route ( "/token" , post ( ) . to ( users:: token:: create_owner_token) )
35+ . route ( "/token" , get ( ) . to ( users:: token:: list_owner_token) )
36+ . route ( "/token" , delete ( ) . to ( users:: token:: delete_owner_token) )
37+ . service (
38+ scope ( "/{owner}" )
39+ . route ( "/repo" , post ( ) . to ( repo:: list:: repo_user_list) )
40+ . route ( "/orgs" , post ( ) . to ( org:: member:: list:: org_user_list) )
41+ )
42+ )
43+ . service (
44+ scope ( "/context" )
45+ . route ( "/current" , get ( ) . to ( users:: context:: current_context) )
46+ . route ( "/list" , get ( ) . to ( users:: context:: list_context) )
47+ . route ( "/switch/{uid}" , post ( ) . to ( users:: context:: switch_context) ) ,
48+ )
49+ . service (
50+ scope ( "/utils" )
51+ . route ( "/base64_captcha" , get ( ) . to ( utils:: base64_captcha:: utils_captcha) )
52+ . route ( "/email_captcha_send" , post ( ) . to ( utils:: email_captcha:: email_captcha) )
53+ . route ( "/email_captcha_check" , post ( ) . to ( utils:: email_captcha:: email_captcha_check) ) ,
54+ )
55+ . service (
56+ scope ( "/repo" )
57+ . route ( "" , post ( ) . to ( repo:: init:: repo_init) )
58+ . route ( "/access" , post ( ) . to ( repo:: init:: repo_access) )
59+ . service (
60+ scope ( "/{owner}/{repo}" )
61+ . route ( "" , post ( ) . to ( repo:: info:: repo_info) )
62+ . route ( "/blob" , post ( ) . to ( repo:: fsops:: blob:: repo_blob) )
63+ . route ( "/star" , post ( ) . to ( repo:: soc:: star:: repo_star) )
64+ . route ( "/watch" , post ( ) . to ( repo:: soc:: watch:: repo_watch) )
65+ . route ( "/can_setting" , get ( ) . to ( repo:: info:: repo_can_setting) )
66+ . service (
67+ scope ( "/branch" )
68+ . route ( "/list" , get ( ) . to ( repo:: fsops:: branch:: list_branch) )
69+ . route ( "/create" , post ( ) . to ( repo:: fsops:: branch:: create_branch) )
70+ . route (
71+ "/delete/{name}" ,
72+ post ( ) . to ( repo:: fsops:: branch:: delete_branch) ,
73+ )
74+ . route (
75+ "/rename/{name}/{new_name}" ,
76+ post ( ) . to ( repo:: fsops:: branch:: rename_branch) ,
77+ )
78+ . route (
79+ "/checkout/{name}" ,
80+ post ( ) . to ( repo:: fsops:: branch:: checkout_head) ,
81+ ) ,
82+ )
83+ . service (
84+ scope ( "/tree" )
85+ . route ( "/list" , post ( ) . to ( repo:: fsops:: tree:: repo_tree) )
86+ . route (
87+ "/message" ,
88+ post ( ) . to ( repo:: fsops:: tree:: repo_tree_message) ,
89+ ) ,
90+ ) ,
91+ ) ,
92+ )
93+ . service (
94+ scope ( "/static" )
95+ . route ( "/upload_avatar" , post ( ) . to ( rstatic:: avatar:: upload_avatar) )
96+ . route ( "/img/{path}" , get ( ) . to ( rstatic:: avatar:: down_avatar) )
97+ )
98+ . service (
99+ scope ( "/orgs" )
100+ . route ( "" , post ( ) . to ( org:: create:: create_org) )
101+ . service (
102+ scope ( "/{org}" )
103+ . route ( "" , get ( ) . to ( org:: info:: org_info) )
104+ . route ( "/can_setting" , get ( ) . to ( org:: info:: org_can_setting) )
105+ . route ( "/member" , post ( ) . to ( org:: member:: list:: org_member_list) )
106+ )
107+ ) ;
110108}
111109
112110async fn v1_hello ( ) -> String {
0 commit comments