Example #1
0
"""pysat URL Configuration for School.Create
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType

from school.views import theme

urlpatterns = [
    path(
        'create',
        view_maker(theme.create_theme,
                   'POST', [
                       ParamType.SchoolIdWithDefault, ParamType.ThemeName,
                       ParamType.ThemeDescription, ParamType.ThemeDeadline
                   ],
                   action=ActionType.ThemeCreate)),
    path(
        'list',
        view_maker(theme.get_list,
                   'GET', [ParamType.SchoolId, ParamType.Page],
                   action=ActionType.UserGet)),
    path('delete', view_maker(theme.delete_theme, 'POST',
                              [ParamType.ThemeId])),
    path(
        'modify',
        view_maker(theme.modify_theme, 'POST', [
            ParamType.ThemeId, ParamType.ThemeNameWithDefault,
            ParamType.ThemeDescriptionWithDefault,
            ParamType.ThemeDeadlineWithDefault
Example #2
0
"""pysat URL Configuration for School.Create
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType

from school.views import school

urlpatterns = [
    path(
        'create',
        view_maker(school.create_school,
                   'POST', [
                       ParamType.Username, ParamType.SchoolName,
                       ParamType.SchoolDescription
                   ], [ParamType.SchoolName],
                   action=ActionType.CreateSchool)),
    path(
        'get_list',
        view_maker(school.get_school_list,
                   'GET', [ParamType.Page, ParamType.SearchText],
                   action=ActionType.GetSchoolList))
]
Example #3
0
"""pysat URL Configuration for message.chat
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType

from message.views import block

urlpatterns = [
    path('list',
         view_maker(block.get_list, 'POST', action=ActionType.NormalUser)),
    path(
        'set',
        view_maker(block.set_block,
                   'POST', [ParamType.Username],
                   action=ActionType.NormalUser)),
    path(
        'unset',
        view_maker(block.unset_block,
                   'POST', [ParamType.Username],
                   action=ActionType.NormalUser))
]
Example #4
0
"""pysat URL Configuration for School.Create
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType

from school.views import user

urlpatterns = [
    path('apply', view_maker(user.apply_for_school, 'POST', [
        ParamType.ApplyReason,
        ParamType.ApplySchoolId
    ], action=ActionType.ApplyForSchool))
]
Example #5
0
"""pysat URL Configuration for Program.User
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType
from program.views import user

urlpatterns = [
    path('submit', view_maker(user.submit, 'POST', [
        ParamType.ProgramName,
        ParamType.ProgramCode,
        ParamType.ProgramDoc,
        ParamType.SchoolId,
        ParamType.ThemeId
    ], action=ActionType.UserAction)),

    path('like', view_maker(user.like, 'POST', [
        ParamType.ProgramId
    ], action=ActionType.UserLike)),

    path('download', view_maker(user.download, 'GET', [
        ParamType.ProgramId
    ], action=ActionType.UserAction))
]
Example #6
0
"""pysat URL Configuration for message.message
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType

from message.views import message

urlpatterns = [
    path(
        'list',
        view_maker(message.get_list,
                   'POST', [ParamType.Username, ParamType.Page],
                   action=ActionType.NormalUser)),
    path(
        'send',
        view_maker(message.send,
                   'POST', [ParamType.Username, ParamType.Content],
                   action=ActionType.NormalUser)),
    path(
        'undo',
        view_maker(message.undo,
                   'POST', [ParamType.Id],
                   action=ActionType.NormalUser))
]
Example #7
0
"""pysat URL Configuration for File Download
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
import file.views.download as views

urlpatterns = [
    path('video', view_maker(views.video, 'GET', [
        ParamType.VideoID
    ]))
]
Example #8
0
"""pysat URL Configuration for File Upload
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
import file.views.upload as views

urlpatterns = [
    path('test', view_maker(views.test, 'POST')),
    path('start', view_maker(views.start, 'POST', [
        ParamType.SchoolId,
        ParamType.CategoryId,
        ParamType.Filename,
        ParamType.VideoTitle,
        ParamType.Description,
        ParamType.FileKey
    ])),
    path('chunk', view_maker(views.chunk, 'POST', [
        ParamType.FileKey,
        ParamType.ChunkId
    ])),
    path('done', view_maker(views.done, 'POST', [
        ParamType.FileKey
    ]))
]
Example #9
0
"""pysat URL Configuration for User.Info
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType

from user.views import info

urlpatterns = [
    path(
        'get',
        view_maker(info.get_info,
                   'GET', [ParamType.UsernameWithDefault],
                   action=ActionType.GetUserInfo)),
    path(
        'modify',
        view_maker(
            info.modify_info,
            'POST', [
                ParamType.UsernameWithDefault, ParamType.RealnameForModify,
                ParamType.MottoForModify, ParamType.PermissionPrivateForModify,
                ParamType.PermissionPublicForModify
            ], [
                ParamType.RealnameForModify,
                ParamType.MottoForModify,
            ],
            action=ActionType.ModifyMyInfo)),
    path(
        'setphone',
Example #10
0
"""pysat URL Configuration for Program.Admin
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType
from program.views import proglist

urlpatterns = [
    path(
        'get',
        view_maker(
            proglist.get_program_list,
            'GET', [
                ParamType.Mine, ParamType.SchoolIdWithDefault,
                ParamType.StatusUp, ParamType.StatusDown, ParamType.Listype,
                ParamType.ThemeIdWithDefault, ParamType.Page
            ],
            action=ActionType.UserGet))
]
Example #11
0
"""pysat URL Configuration for File List
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
import file.views.filelist as views

urlpatterns = [
    path(
        'info',
        view_maker(views.info, 'GET',
                   [ParamType.SchoolId, ParamType.CategoryId, ParamType.Page]))
]
Example #12
0
"""pysat URL Configuration for User.Sign
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from utils.permission import ActionType

from user.views import sign

urlpatterns = [
    path(
        'login',
        view_maker(sign.signin, 'POST',
                   [ParamType.Username, ParamType.Password],
                   [ParamType.Username, ParamType.Password])),
    path(
        'register',
        view_maker(sign.signup, 'POST', [
            ParamType.Username, ParamType.Password, ParamType.Phone,
            ParamType.CAPTCHA
        ], [ParamType.Username, ParamType.Password, ParamType.Phone])),
    path('logout', view_maker(sign.signout, 'POST')),
    path(
        'verify',
        view_maker(sign.verify_phone, 'POST', [ParamType.Phone],
                   [ParamType.Phone])),
    path(
        'modify',
        view_maker(sign.change_password,
                   'POST', [ParamType.OldPassword, ParamType.NewPassword],
Example #13
0
"""pysat URL Configuration for Session
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from session.views import start_session, check_session

urlpatterns = [
    path('start', view_maker(start_session, 'POST')),
    path('check', view_maker(check_session, 'GET', [ParamType.Token]))
]
Example #14
0
"""pysat URL Configuration for School.admin
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType

from school.views import admin

urlpatterns = [
    path('approve', view_maker(admin.approve, 'POST', [
        ParamType.ApplyId,
        ParamType.Approve
    ])),
    path('applylist', view_maker(admin.get_apply_list, 'POST', [
        ParamType.SchoolId,
        ParamType.ApplyListType,
        ParamType.Page
    ]))
]
Example #15
0
"""pysat URL Configuration for User.List
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
# from utils.permission import ActionType

from user.views import userlist

urlpatterns = [
    path(
        'get',
        view_maker(userlist.getlist, 'GET', [
            ParamType.ShowInvalid, ParamType.ManagerFirst, ParamType.SchoolId,
            ParamType.Page
        ]))
]
Example #16
0
"""pysat URL Configuration for message.chat
"""
from django.urls import path

from utils.views import view_maker
from utils.permission import ActionType

from message.views import chat

urlpatterns = [
    path('list', view_maker(chat.get_list,
                            'POST',
                            action=ActionType.NormalUser))
]
Example #17
0
"""pysat URL Configuration for Program.Admin
"""
from django.urls import path

from utils.views import view_maker
from utils.params import ParamType
from program.views import admin

urlpatterns = [
    path('download', view_maker(admin.download, 'GET', [
        ParamType.ProgramId
    ])),

    path('status', view_maker(admin.change_status, 'POST', [
        ParamType.ProgramId,
        ParamType.SourceStatus,
        ParamType.TargetStatus
    ]))
]