123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532 |
- using AIPlatform.Protocol.Entities;
- using AIPlatform.Protocol.Entities.Ventilator;
- using AIPlatform.Protocol.Model;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Threading.Tasks;
- namespace aipadmin
- {
- public class AdminManager
- {
- public static AdminManager Shared { get; }
- static AdminManager()
- {
- Shared = new AdminManager();
- }
- private AdminAccountSession _session;
- private LabelerAccountSession _seniorLabelerSession;
- /// <summary>
- /// Gets if the admin has been logon.
- /// </summary>
- public bool HasLogon => _session != null;
- /// <summary>
- /// Gets if current login admin is root admin.
- /// </summary>
- public bool IsRoot { get; private set; }
- /// <summary>
- /// Gets the current session id.
- /// </summary>
- public AdminAccountSession Session
- {
- get => _session;
- private set
- {
- if (_session != value)
- {
- _session = value;
- SessionChanged?.Invoke(this, EventArgs.Empty);
- }
- }
- }
- /// <summary>
- /// Gets the current session id.
- /// </summary>
- public LabelerAccountSession SeniorLabelerSession
- {
- get => _seniorLabelerSession;
- private set
- {
- if (_seniorLabelerSession != value)
- {
- _seniorLabelerSession = value;
- }
- }
- }
- /// <summary>
- /// Raised when session id changed.
- /// </summary>
- public event EventHandler SessionChanged;
- /// <summary>
- /// Login admin to the system,
- /// </summary>
- /// <param name="name">The name of the admin</param>
- /// <param name="password">The password of the admin</param>
- /// <returns>The login result.</returns>
- public async Task<LoginResultCode> LoginAsync(string name, string password)
- {
- var result = await ServerProxy.AdminService.LoginAsync(name, password);
- if (result.ResultCode == LoginResultCode.Success)
- {
- _session = result.Session;
- IsRoot = _session.IsRoot;
- }
- else
- {
- _session = null;
- IsRoot = false;
- }
- return result.ResultCode;
- }
- /// <summary>
- /// SeniorLabeler login to the system to check the labeler statistics
- /// </summary>
- /// <param name="name">The name of the senior labeler</param>
- /// <param name="password">The password of the senior labeler</param>
- /// <returns>The login result.</returns>
- public async Task<LoginResultCode> SeniorLabelerLoginAsync(string name, string password)
- {
- var result = await ServerProxy.AdminService.SeniorLabelerLoginAsync(name, password);
- if (result.ResultCode == LoginResultCode.Success)
- {
- _seniorLabelerSession = result.Session;
- }
- else
- {
- _session = null;
- }
- return result.ResultCode;
- }
- /// <summary>
- /// LogOff from the system.
- /// </summary>
- /// <returns></returns>
- public async Task LogOff()
- {
- await ServerProxy.AdminService.LogOff(_session.Id);
- }
- /// <summary>
- /// Set session manually.
- /// </summary>
- /// <param name="session">The session to set.</param>
- public void SetSession(AdminAccountSession session)
- {
- if (session == null)
- {
- _session = null;
- IsRoot = false;
- }
- else
- {
- _session = session;
- IsRoot = _session.IsRoot;
- }
- }
- #region Organization
- /// <summary>
- /// Get all organizations from system
- /// </summary>
- /// <returns>The loaded organizations.</returns>
- public async Task<List<Organization>> GetOrganizationsAsync()
- {
- return await ServerProxy.AdminService.GetOrganizationsAsync(_session.Id);
- }
- /// <summary>
- /// Get all organizations from system
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched key word.</param>
- /// <returns>The loaded organizations.</returns>
- public async Task<List<Organization>> GetOrganizationsAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetOrganizationsAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get total organization count.
- /// </summary>
- /// <param name="keyword">The searched key word.</param>
- /// <returns>The organization count.</returns>
- public async Task<int> GetOrganizationCountAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetOrganizationCountAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Create an organization
- /// </summary>
- /// <param name="name">The name of the organization.</param>
- /// <param name="description">The description of the organization.</param>
- /// <returns></returns>
- public async Task<Organization> CreateOrganizationAsync(string name, string description, List<AuthorityBase> authorities, List<SupportedDataType> supportedDataTypes)
- {
- return await ServerProxy.AdminService.CreateOrganizationAsync(_session.Id, name, description, authorities, supportedDataTypes);
- }
- /// <summary>
- /// Delete an organization from the system.
- /// </summary>
- /// <returns>Void</returns>
- public async Task DeleteOrganizationAsync(long id)
- {
- await ServerProxy.AdminService.DeleteOrganizationAsync(_session.Id, id);
- }
- /// <summary>
- /// Check whether there are children in the organization.
- /// </summary>
- /// <param name="id">The id of organization.</param>
- /// <returns>The loaded organizations.</returns>
- public async Task<bool> ExistOrganizationChildrenAsync(long id)
- {
- return await ServerProxy.AdminService.ExistOrganizationChildrenAsync(_session.Id, id);
- }
- /// <summary>
- /// 检查组织下是否已绑定用户
- /// </summary>
- /// <param name="organizationId"></param>
- /// <returns></returns>
- public async Task<bool> ExistAccountByOrganizationAsync(long organizationId)
- {
- return await ServerProxy.AdminService.ExistAccountByOrganizationAsync(_session.Id, organizationId);
- }
- /// <summary>
- /// Update one organization.
- /// </summary>
- /// <param name="id">The id of organization.</param>
- /// <param name="description">The description of the organization.</param>
- /// <returns>Void</returns>
- public async Task UpdateOrganizationAsync(long id, string description, List<AuthorityBase> authorities, List<SupportedDataType> supportedDataTypes)
- {
- await ServerProxy.AdminService.UpdateOrganizationAsync(_session.Id, id, description, authorities, supportedDataTypes);
- }
- #endregion Organization
- #region 机构管理
- /// <summary>
- /// Get the Institution from system
- /// </summary>
- /// <returns>The loaded Institution.</returns>
- public async Task<Institution> GetInstitutionAsync(long id)
- {
- return await ServerProxy.AdminService.GetInstitutionAsync(_session.Id, id);
- }
- /// <summary>
- /// Get the Institutions by organizationId
- /// </summary>
- /// <returns>The loaded Institutions.</returns>
- public async Task<List<Institution>> GetInstitutionsByOrganizationIdAsync(long organizationId)
- {
- return await ServerProxy.AdminService.GetInstitutionsByOrganizationIdAsync(_session.Id, organizationId);
- }
- /// <summary>
- /// Get all Institutions from system
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched key word.</param>
- /// <returns>The loaded Institutions.</returns>
- public async Task<List<Institution>> GetInstitutionsAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetInstitutionsAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get total Institution count.
- /// </summary>
- /// <param name="keyword">The searched key word.</param>
- /// <returns>The Institution count.</returns>
- public async Task<int> GetInstitutionCountAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetInstitutionCountAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Create the Institution
- /// </summary>
- /// <param name="name">The name of the Institution.</param>
- /// <param name="description">The description of the Institution.</param>
- /// <returns></returns>
- public async Task<Institution> CreateInstitutionAsync(string name, string description, List<EntityBase> organizations, InstitutionType type, bool isPaid)
- {
- return await ServerProxy.AdminService.CreateInstitutionAsync(_session.Id, name, description, organizations, type, isPaid);
- }
- /// <summary>
- /// Delete the Institution from the system.
- /// </summary>
- /// <returns>Void</returns>
- public async Task DeleteInstitutionAsync(long id)
- {
- await ServerProxy.AdminService.DeleteInstitutionAsync(_session.Id, id);
- }
- /// <summary>
- /// Update the Institution.
- /// </summary>
- /// <param name="id">The id of Institution.</param>
- /// <param name="description">The description of the Institution.</param>
- /// <returns>Void</returns>
- public async Task UpdateInstitutionAsync(long id, string description, List<EntityBase> organizations, InstitutionType type, bool isPaid)
- {
- await ServerProxy.AdminService.UpdateInstitutionAsync(_session.Id, id, description, organizations, type, isPaid);
- }
- /// <summary>
- /// 检查机构下是否已绑定用户
- /// </summary>
- /// <param name="sessionId"></param>
- /// <param name="institutionId"></param>
- /// <returns></returns>
- /// <exception cref="InvalidOperationException"></exception>
- public async Task<bool> ExistAccountByInstitutionIdAsync(long institutionId)
- {
- return await ServerProxy.AdminService.ExistAccountByInstitutionIdAsync(_session.Id, institutionId);
- }
- #endregion 机构管理
- #region admin
- /// <summary>
- /// Get all admins from system
- /// </summary>
- /// <returns>The loaded admins.</returns>
- public async Task<List<Account>> GetAccountsAsync(Role role = Role.None)
- {
- return await ServerProxy.AdminService.GetAccountsAsync(_session.Id, role);
- }
- /// <summary>
- /// Get total labeler count.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The developer count.</returns>
- public async Task<int> GetAccountCountAsync(string keyword, long organizationId, long institutionId, Role role = Role.None)
- {
- return await ServerProxy.AdminService.GetAccountCountAsync(_session.Id, keyword, organizationId, institutionId, role);
- }
- /// <summary>
- /// Get all admins from system
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched key word.</param>
- /// <returns>The loaded admins.</returns>
- public async Task<List<Account>> GetAccountsAsync(int pageIndex, int pageSize, string keyword, long organizationId, long institutionId, Role role = Role.None)
- {
- return await ServerProxy.AdminService.GetAccountsAsync(_session.Id, pageIndex, pageSize, keyword, organizationId, institutionId, role);
- }
- /// <summary>
- /// Create a admin
- /// </summary>
- /// <param name="name">The name of the admin.</param>
- /// <param name="fullName">The full name of the admin.</param>
- /// <param name="password">The password of the admin account.</param>
- /// <returns></returns>
- public async Task<Account> CreateAccountAsync(string name, string fullName, string password, List<EntityBase> organizations, List<Role> roles, List<AuthorityBase> authorities,
- DeveloperAuthorityInfo developerAuthorityInfo, LabelerAuthorityInfo labelerAuthorityInfo, int handyToolExportDelay, long institutionId)
- {
- return await ServerProxy.AdminService.CreateAccountAsync(_session.Id, name, fullName, password, organizations, roles, authorities, developerAuthorityInfo, labelerAuthorityInfo, handyToolExportDelay, institutionId);
- }
- /// <summary>
- /// Delete a admin from the system.
- /// </summary>
- /// <returns>Void</returns>
- public async Task DeleteAccountAsync(long id)
- {
- await ServerProxy.AdminService.DeleteAccountAsync(_session.Id, id);
- }
- /// <summary>
- /// Update one admin.
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public async Task UpdateAccountAsync(long id, string fullName, List<EntityBase> organizations, List<Role> roles, List<AuthorityBase> authorities,
- DeveloperAuthorityInfo developerAuthorityInfo, LabelerAuthorityInfo labelerAuthorityInfo, int handyToolExportDelay, long institutionId)
- {
- await ServerProxy.AdminService.UpdateAccountAsync(_session.Id, id, fullName, organizations, roles, authorities, developerAuthorityInfo, labelerAuthorityInfo, handyToolExportDelay, institutionId);
- }
- /// <summary>
- /// Update one admin password.
- /// </summary>
- /// <param name="id">The id of admin to handle.</param>
- /// <param name="password">The password of the admin.</param>
- /// <returns>Void</returns>
- public async Task UpdateAccountPasswordAsync(long id, string password)
- {
- await ServerProxy.AdminService.UpdateAccountPasswordAsync(_session.Id, id, password);
- }
- /// <summary>
- /// Get the admin by admin id.
- /// </summary>
- /// <param name="adminId">The id of the admin</param>
- /// <returns>The admin</returns>
- public async Task<Account> GetAccountAsync(long adminId)
- {
- return await ServerProxy.AdminService.GetAccountAsync(_session.Id, adminId);
- }
- #endregion admin
- #region developer
- /// <summary>
- /// Get all developers from system
- /// </summary>
- /// <returns>The loaded developers.</returns>
- public async Task<List<DeveloperAccount>> GetDevelopersAsync()
- {
- return await ServerProxy.AdminService.GetDevelopersAsync(_session.Id);
- }
- /// <summary>
- /// Get all developers from system
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched key word.</param>
- /// <returns>The loaded developers.</returns>
- public async Task<List<DeveloperAccount>> GetDevelopersAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.FindDevelopersAsync(_session.Id, keyword, pageIndex, pageSize);
- }
- /// <summary>
- /// Get total developer count.
- /// </summary>
- /// <param name="keyword">The searched key word.</param>
- /// <returns>The developer count.</returns>
- public async Task<int> GetDeveloperCountAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetDeveloperCountAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Create a developer
- /// </summary>
- /// <param name="name">The name of the developer.</param>
- /// <param name="fullName">The full name of the developer.</param>
- /// <param name="password">The password of the developer account.</param>
- /// <returns></returns>
- public async Task<DeveloperAccount> CreateDeveloperAsync(string name, string fullName, string password, DateTime expireTime, List<EntityBase> organizations)
- {
- return await ServerProxy.AdminService.CreateDeveloperAsync(_session.Id, name, fullName, password, expireTime, organizations);
- }
- /// <summary>
- /// Delete a developer from the system.
- /// </summary>
- /// <param name="id">The if of developer to delete.</param>
- /// <returns>Void</returns>
- public async Task DeleteDeveloperAsync(long id)
- {
- await ServerProxy.AdminService.DeleteDeveloperAsync(_session.Id, id);
- }
- /// <summary>
- /// Create a work token for the developer.
- /// </summary>
- /// <param name="developer">The developer to handle.</param>
- /// <param name="expireTime">The token expire time.</param>
- /// <returns>Void</returns>
- public async Task CreateWorkTokenAsync(DeveloperAccount developer, DateTime expireTime)
- {
- await ServerProxy.AdminService.CreateTokenAsync(_session.Id, developer.Id, expireTime);
- }
- /// <summary>
- /// Delete work token.
- /// </summary>
- /// <param name="developer">The developer to handle.</param>
- /// <returns></returns>
- public async Task DeleteWorkTokenAsync(DeveloperAccount developer)
- {
- await ServerProxy.AdminService.DeleteWorkTokenAsync(_session.Id, developer.Id);
- }
- /// <summary>
- /// Update one developer account.
- /// </summary>
- /// <param name="id">The id of developer to handle.</param>
- /// <param name="fullName">The full name of the developer.</param>
- /// <param name="expireTime">The token expire time.</param>
- /// <returns>Void</returns>
- public async Task UpdateDeveloperAsync(long id, string fullName, DateTime expireTime, List<EntityBase> organizations)
- {
- await ServerProxy.AdminService.UpdateDeveloperAsync(_session.Id, id, fullName, expireTime, organizations);
- }
- /// <summary>
- /// Update one developer password.
- /// </summary>
- /// <param name="id">The id of developer to handle.</param>
- /// <param name="password">The password of the developer.</param>
- /// <returns>Void</returns>
- public async Task UpdateDeveloperPasswordAsync(long id, string password)
- {
- await ServerProxy.AdminService.UpdateDeveloperPasswordAsync(_session.Id, id, password);
- }
- #endregion developer
- #region labeler
- /// <summary>
- /// Get total labeler count.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The developer count.</returns>
- public async Task<int> GetLabelerCountAsync(string keyword, long organizationId, long institutionId)
- {
- return await ServerProxy.AdminService.GetAccountCountAsync(_session.Id, keyword, organizationId, institutionId, Role.Labeler);
- }
- /// <summary>
- /// Get total labeler count.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>The developer count.</returns>
- public async Task<int> GetLabelerCountAsync(string keyword, DateTime start, DateTime end)
- {
- return await ServerProxy.AdminService.GetLabelerCountAsync(_session.Id, keyword, start, end);
- }
- /// <summary>
- /// Get labeled case count.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>The labeled case count</returns>
- public async Task<int> GetSameBatchLabelCaseCountAsync(long organizationId, long imageCategoryId, string keyword, DateTime start = new DateTime(), DateTime end = new DateTime(), DateTime updateStart = new DateTime(), DateTime updateEnd = new DateTime())
- {
- return await ServerProxy.AdminService.GetSameBatchLabelCaseCountAsync(_session.Id, organizationId, imageCategoryId, keyword, start, end, updateStart, updateEnd);
- }
- /// <summary>
- /// Get all developers from system
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The loaded developers.</returns>
- public async Task<List<LabelerAccount>> GetLabelersAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetLabelersAsync(_session.Id, keyword, pageIndex, pageSize);
- }
- /// <summary>
- /// Get all developers from system
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched keyword.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>The loaded developers.</returns>
- public async Task<List<LabelerAccount>> GetLabelersAsync(int pageIndex, int pageSize, string keyword, DateTime start, DateTime end)
- {
- return await ServerProxy.AdminService.GetLabelersAsync(_session.Id, keyword, pageIndex, pageSize, start, end);
- }
- /// <summary>
- /// Create a labeler
- /// </summary>
- /// <param name="name">The name of the labeler</param>
- /// <param name="fullName">The full name of the labeler</param>
- /// <param name="password">The password of the labeler</param>
- /// <param name="comeFrom">where the labeler come from</param>
- /// <param name="qualification">The qualification of the labeler</param>
- /// <param name="seniorLabeler">The teacher of the labeler</param>
- /// <param name="organizations">The organizations of the labeler</param>
- /// <returns></returns>
- public async Task<LabelerAccount> CreateLabelerAsync(string name, string fullName, string password, string comeFrom, string qualification, bool isRemote, EntityBase seniorLabeler, List<EntityBase> organizations)
- {
- return await ServerProxy.AdminService.CreateLabelerAsync(_session.Id, name, fullName, password, comeFrom, qualification, isRemote, seniorLabeler, organizations);
- }
- /// <summary>
- /// Delete a labeler from the system.
- /// </summary>
- /// <returns>Void</returns>
- public async Task DeleteLabelerAsync(long id)
- {
- await ServerProxy.AdminService.DeleteLabelerAsync(_session.Id, id);
- }
- /// <summary>
- /// Update a labeler
- /// </summary>
- /// <param name="id">The id of the labeler</param>
- /// <param name="fullName">The full name of the labeler</param>
- /// <param name="comeFrom">where the labeler come from</param>
- /// <param name="qualification">The qualification of the labeler</param>
- /// <param name="seniorLabeler">The teacher of the labeler</param>
- /// <param name="organizations">The organizations of the labeler</param>
- /// <returns></returns>
- public async Task UpdateLabelerAsync(long id, string fullName, string comeFrom, string qualification, bool isRemote, EntityBase seniorLabeler, List<EntityBase> organizations)
- {
- await ServerProxy.AdminService.UpdateLabelerAsync(_session.Id, id, fullName, comeFrom, qualification, isRemote, seniorLabeler, organizations);
- }
- /// <summary>
- /// Update a labeler password.
- /// </summary>
- /// <param name="id">The id of labeler to handle.</param>
- /// <param name="password">The password of the labeler.</param>
- /// <returns>Void</returns>
- public async Task UpdateLabelerPasswordAsync(long id, string password)
- {
- await ServerProxy.AdminService.UpdateLabelerPasswordAsync(_session.Id, id, password);
- }
- #endregion labeler
- #region images
- /// <summary>
- /// Get group count by imageCategoryId.
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <returns>The group count.</returns>
- public async Task<int> GetUltrasoundGroupCountAsync(long imageCategoryId, string keyword = null)
- {
- return await ServerProxy.AdminService.GetUltrasoundGroupCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get the labeled group count by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The image category id to handle.</param>
- /// <returns>The labeled group count.</returns>
- public async Task<int> GetLabeledGroupCountAsync(long imageCategoryId, string keyword = null)
- {
- return await ServerProxy.AdminService.GetLabeledGroupCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get the un-labeled group count by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The image category id to handle.</param>
- /// <returns>The un-labeled group count.</returns>
- public async Task<int> GetUnLabeledGroupCountAsync(long imageCategoryId, string keyword = null)
- {
- return await ServerProxy.AdminService.GetUnLabeledGroupCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get gold standard group count by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <returns>The group count.</returns>
- public async Task<int> GetGoldStandardGroupCountAsync(long imageCategoryId, string keyword)
- {
- return await ServerProxy.AdminService.GetGoldStandardGroupCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get the labeled file count by tag
- /// </summary>
- /// <param name="imageCategoryId">The image category id to handle.</param>
- /// <returns>The labeled file count.</returns>
- public async Task<int> GetLabeledFileCountAsync(long imageCategoryId, string keyword = null)
- {
- return await ServerProxy.AdminService.GetLabeledFileCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get the un-labeled file count by tag
- /// </summary>
- /// <param name="imageCategoryId">The image category id to handle.</param>
- /// <returns>The un-labeled file count.</returns>
- public async Task<int> GetUnLabeledFileCountAsync(long imageCategoryId, string keyword = null)
- {
- return await ServerProxy.AdminService.GetUnLabeledFileCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get image count by imageCategoryId.
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <returns>The image count.</returns>
- public async Task<int> GetUltrasoundFileCountAsync(long imageCategoryId, string keyword = null)
- {
- return await ServerProxy.AdminService.GetUltrasoundFileCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get gold standard image count by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <returns>The image count.</returns>
- public async Task<int> GetGoldStandardFileCountAsync(long imageCategoryId, string keyword)
- {
- return await ServerProxy.AdminService.GetGoldStandardFileCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get un-gold standard image count by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <returns>The image count.</returns>
- public async Task<int> GetUnGoldStandardFileCountAsync(long imageCategoryId, string keyword)
- {
- return await ServerProxy.AdminService.GetUnGoldStandardFileCountAsync(_session.Id, imageCategoryId, keyword);
- }
- /// <summary>
- /// Get the labeled file count by tag
- /// </summary>
- /// <param name="imageCategoryId">The image category id to handle.</param>
- /// <returns>The labeled file count.</returns>
- public async Task<int> GetDisputeLabeledFileCountAsync(long imageCategoryId, string keyword = null, bool isAssign = false, string keyWordLabele = null)
- {
- return await ServerProxy.AdminService.GetDisputeLabeledFileCountAsync(_session.Id, imageCategoryId, keyword, isAssign, keyWordLabele);
- }
- /// <summary>
- /// Get files by ultrasoundGroupId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <param name="ultrasoundGroupId">The id of ultrasound group.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<PreviewFileModel>> GetUltrasoundFilesByGroupIdAsync(long imageCategoryId, long ultrasoundGroupId)
- {
- return await ServerProxy.AdminService.GetUltrasoundFilesByGroupIdAsync(_session.Id, imageCategoryId, ultrasoundGroupId);
- }
- /// <summary>
- /// Get images by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<PreviewFileModel>> GetUltrasoundFilesInGroupAsync(long imageCategoryId, string keyword, int pageIndex, int pageSize)
- {
- return await ServerProxy.AdminService.GetUltrasoundFilesInGroupAsync(_session.Id, imageCategoryId, keyword, pageIndex, pageSize);
- }
- /// <summary>
- /// Get latest labeled files by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<PreviewFileModel>> GetLatestLabeledFilesInGroupAsync(long imageCategoryId, string keyword, int pageIndex, int pageSize)
- {
- return await ServerProxy.AdminService.GetLatestLabeledFilesInGroupAsync(_session.Id, imageCategoryId, keyword, pageIndex, pageSize);
- }
- /// <summary>
- /// Get unlabeled files by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<PreviewFileModel>> GetUnLabeledFilesInGroupAsync(long imageCategoryId, string keyword, int pageIndex, int pageSize)
- {
- return await ServerProxy.AdminService.GetUnLabeledFilesInGroupAsync(_session.Id, imageCategoryId, keyword, pageIndex, pageSize);
- }
- /// <summary>
- /// Get gold standard images by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<PreviewFileModel>> GetGoldStandardFilesInGroupAsync(long imageCategoryId, string keyword, int pageIndex, int pageSize)
- {
- return await ServerProxy.AdminService.GetGoldStandardFilesInGroupAsync(_session.Id, imageCategoryId, keyword, pageIndex, pageSize);
- }
- /// <summary>
- /// Get labeled files by imageCategoryId
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<LabeledUltrasoundFile>> GetLabeledFilesAsync(long imageCategoryId, int pageIndex, int pageSize)
- {
- return await ServerProxy.AdminService.GetLabeledFilesAsync(_session.Id, imageCategoryId, pageIndex, pageSize);
- }
- /// <summary>
- /// Get latest labeled files by imageCategoryId/
- /// </summary>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<PreviewFileModel>> GetDisputeUltrasoundFilesAsync(long imageCategoryId, string keyword, int pageIndex, int pageSize, bool isAssign, string keyWordLabele)
- {
- return await ServerProxy.AdminService.GetDisputeLabeledFilesAsync(_session.Id, imageCategoryId, keyword, pageIndex, pageSize, isAssign, keyWordLabele);
- }
- /// <summary>
- /// Get all labeler infos in the ultrasound file.
- /// </summary>
- /// <param name="ultrasoundFileId">The id of ultrasound file.</param>
- /// <param name="imageCategoryId">The id of image category.</param>
- /// <returns></returns>
- public async Task<List<LabelerInfo>> GetLabelerInfosAsync(long ultrasoundFileId, long imageCategoryId)
- {
- return await ServerProxy.AdminService.GetLabelerInfosAsync(_session.Id, ultrasoundFileId, imageCategoryId);
- }
- /// <summary>
- /// Get the latest labeled file info for one source image by labeledUltrasoundFileId.
- /// </summary>
- /// <returns>found ultrasound image</returns>
- public async Task<LabeledUltrasoundFileInfo> GetLatestLabeledUltrasoundFileInfoAsync(long labeledUltrasoundFileId)
- {
- return await ServerProxy.AdminService.GetLatestLabeledUltrasoundFileInfoAsync(_session.Id, labeledUltrasoundFileId);
- }
- /// <summary>
- /// Get labeled files except gold standard by ultrasound image id.
- /// </summary>
- /// <param name="ultrasoundFileId">The id of ultrasound file.</param>
- /// <returns>The loaded files.</returns>
- public async Task<List<LabeledUltrasoundFileInfo>> GetLabeledFilesByUltrasoundFileIdAsync(long ultrasoundFileId, long imageCategoryId)
- {
- return await ServerProxy.AdminService.GetLabeledUltrasoundFilesByUltrasoundFileIdAsync(_session.Id, ultrasoundFileId, imageCategoryId);
- }
- /// <summary>
- /// Get labeled files except gold standard by ultrasound image id.
- /// </summary>
- /// <param name="ultrasoundFileId">The id of ultrasound file.</param>
- /// <returns>The loaded files.</returns>
- public async Task<int> GetLabeledFilesCountByUltrasoundFileIdAsync(long ultrasoundFileId)
- {
- return await ServerProxy.AdminService.GetLabeledUltrasoundFilesCountByUltrasoundFileIdAsync(_session.Id, ultrasoundFileId);
- }
- /// <summary>
- /// Delete ultrasound image from the system.
- /// </summary>
- /// <param name="ultrasoundFileId">The id of the ultrasound image.</param>
- /// <returns></returns>
- public async Task DeleteUltrasoundFileAsync(long ultrasoundFileId)
- {
- await ServerProxy.AdminService.DeleteUltrasoundFileAsync(_session.Id, ultrasoundFileId);
- }
- /// <summary>
- /// Delete labeled ultrasound image from the system.
- /// </summary>
- /// <param name="labeledUltrasoundFileId">The id of the ultrasound image.</param>
- /// <returns></returns>
- public async Task DeleteLabeledUltrasoundFileAsync(long labeledUltrasoundFileId)
- {
- await ServerProxy.AdminService.DeleteLabeledUltrasoundFileAsync(_session.Id, labeledUltrasoundFileId);
- }
- /// <summary>
- /// Delete all labeled ultrasound image for one ultrasound image by the ultrasound image id.
- /// </summary>
- /// <param name="ultrasoundFileId">The id of the ultrasound image.</param>
- /// <returns></returns>
- public async Task DeleteAllLabeledUltrasoundFilesByUltrasoundFileIdAsync(long ultrasoundFileId)
- {
- await ServerProxy.AdminService.DeleteAllLabeledUltrasoundFilesByUltrasoundFileIdAsync(_session.Id, ultrasoundFileId);
- }
- /// <summary>
- /// Update labeled ultrasound image.
- /// </summary>
- /// <param name="labeledUltrasoundFileId">The id of the ultrasound image.</param>
- /// <param name="isGoldStandard">The value to indicate whether the labeled file is gold standard or not.</param>
- /// <returns></returns>
- public async Task UpdateLabeledUltrasoundFileAsync(long labeledUltrasoundFileId, bool isGoldStandard)
- {
- await ServerProxy.AdminService.UpdateLabeledUltrasoundFileAsync(_session.Id, labeledUltrasoundFileId, isGoldStandard);
- }
- /// <summary>
- /// Update labeled ultrasound image's is adoptable state.
- /// </summary>
- /// <param name="labeledUltrasoundFileId">The id of the ultrasound image.</param>
- /// <param name="isAdoptable">The value to indicate whether the labeled file is adoptable or not.</param>
- /// <returns></returns>
- public async Task UpdateLabeledUltrasoundFileIsAdoptableAsync(long labeledUltrasoundFileId, bool isAdoptable)
- {
- await ServerProxy.AdminService.UpdateLabeledUltrasoundFileIsAdoptableAsync(_session.Id, labeledUltrasoundFileId, isAdoptable);
- }
- /// <summary>
- /// Get archived image by archived image id.
- /// </summary>
- /// <param name="archivedImageId">The id of the archived image.</param>
- /// <returns>The found archived image.</returns>
- public async Task<ArchivedImage> GetArchivedImageAsync(long archivedImageId)
- {
- return await ServerProxy.AdminService.GetArchivedImageAsync(_session.Id, archivedImageId);
- }
- /// <summary>
- /// Get the labeled result by id.
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public async Task<LabeledResult> GetLabeledResultAsync(long id)
- {
- return await ServerProxy.AdminService.GetLabeledResultAsync(_session.Id, id);
- }
- /// <summary>
- /// Get un-assigned image count.
- /// </summary>
- /// <param name="imageCategoryId">The id of the tag.</param>
- /// <returns>The image's count.</returns>
- public async Task<int> GetUnAssignedImageCountAsync(long imageCategoryId)
- {
- return await ServerProxy.AdminService.GetUnAssignedImageCountAsync(_session.Id, imageCategoryId);
- }
- /// <summary>
- /// Get un-adoptable image count.
- /// </summary>
- /// <param name="imageCategoryId">The id of the tag.</param>
- /// <returns>The image's count.</returns>
- public async Task<int> GetUnAdoptableImageCountAsync(long imageCategoryId)
- {
- return await ServerProxy.AdminService.GetUnAdoptableImageCountAsync(_session.Id, imageCategoryId);
- }
- /// <summary>
- /// Get the assigned label cases.
- /// </summary>
- /// <param name="sameBatchLabelCaseId">The id of the same batch label case</param>
- /// <returns>The cases</returns>
- public async Task<List<AssignedLabelCase>> GetAssignedLabelCasesBySameBatchLabelCaseIdAsync(long sameBatchLabelCaseId)
- {
- return await ServerProxy.AdminService.GetAssignedLabelCasesBySameBatchLabelCaseIdAsync(_session.Id, sameBatchLabelCaseId);
- }
- /// <summary>
- /// Get case image count.
- /// </summary>
- /// <param name="caseId">The case id</param>
- /// <returns>The case image count.</returns>
- public async Task<int> GetCaseImageCountAsync(long caseId)
- {
- return await ServerProxy.AdminService.GetCaseImageCountAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Get case image count.
- /// </summary>
- /// <param name="caseId">The case id</param>
- /// <returns>The labeled file count</returns>
- public async Task<int> GetLabeledCaseImageCountAsync(long caseId)
- {
- return await ServerProxy.AdminService.GetLabeledCaseImageCountAsync(_session.Id, caseId);
- }
- #endregion images
- #region uploader
- /// <summary>
- /// Add one un-labeled file into the system.
- /// </summary>
- /// <param name="imageCategoryId">The image category id</param>
- /// <param name="imageBatchId">The image batch id</param>
- /// <returns>Void</returns>
- public async Task<OpResult> AddUnLabeledFileAsync(long organinzationId, long imageCategoryId, long imageBatchId, UploadFileModel file)
- {
- return await ServerProxy.AdminService.AddUnLabeledFileAsync(_session.Id, organinzationId, imageCategoryId, imageBatchId, file);
- }
- /// <summary>
- /// 分段上传视频
- /// </summary>
- /// <param name="fileData"></param>
- /// <param name="fileName"></param>
- /// <param name="fileId"></param>
- /// <returns></returns>
- public async Task<OpResult> UploadVideoBatchSizeAsync(byte[] fileData, string fileName, string fileId)
- {
- try
- {
- using (var fileStream = new MemoryStream(fileData))
- {
- long batchSize = 10 * 1024 * 1024; // 10MB
- int bytesRead;
- var restBufferSize = fileStream.Length;
- if (restBufferSize < batchSize)
- {
- batchSize = restBufferSize;
- }
- byte[] buffer = new byte[batchSize];
- // 分块上传
- while ((bytesRead = await fileStream.ReadAsync(buffer, 0, (int)batchSize)) > 0)
- {
- var uploadResult = await ServerProxy.AdminService.UploadVideoBatchSizeAsync(fileId, fileName, buffer);
- restBufferSize = restBufferSize - batchSize;
- if (restBufferSize < batchSize && restBufferSize > 0)
- {
- batchSize = restBufferSize;
- Array.Resize(ref buffer, (int)batchSize);
- }
- if (uploadResult == null || uploadResult.ResultCode == OpResultCode.Error)
- {
- return uploadResult;
- }
- }
- }
- return new OpResult { ResultCode = OpResultCode.Success };
- }
- catch (Exception ex)
- {
- return new OpResult { ResultCode = OpResultCode.Error, Message = ex.ToString() };
- }
- }
- /// <summary>
- /// Get all labelers.
- /// </summary>
- /// <returns>LabelerAccounts from the system.</returns>
- public async Task<List<LabelerAccount>> GetLabelersAsync()
- {
- return await ServerProxy.AdminService.GetLabelersAsync(_session.Id);
- }
- /// <summary>
- /// Get senior labelers.
- /// </summary>
- /// <returns>LabelerAccounts from the system.</returns>
- public async Task<List<LabelerAccount>> GetSeniorLabelersAsync()
- {
- return await ServerProxy.AdminService.GetSeniorLabelersAsync(_session.Id);
- }
- #endregion uploader
- #region LabelPackage
- /// <summary>
- /// Create a label package/
- /// </summary>
- /// <param name="name">The name of the package.</param>
- /// <param name="organizations">The organizations of the package.</param>
- /// <returns></returns>
- public async Task<LabelPackage> CreateLabelPackageAsync(string name, List<EntityBase> organizations)
- {
- return await ServerProxy.AdminService.CreateLabelPackageAsync(_session.Id, name, organizations);
- }
- /// <summary>
- /// Create a label package content.
- /// </summary>
- /// <param name="content">The content</param>
- /// <returns>The id of the content</returns>
- public async Task<long> CreateLabelPackageContentAsync(string content)
- {
- return await ServerProxy.AdminService.CreateLabelPackageContentAsync(_session.Id, content);
- }
- /// <summary>
- /// Update the label package content.
- /// </summary>
- /// <param name="labelPackageContentId">The id of the content.</param>
- /// <param name="content">The content</param>
- /// <returns>Void</returns>
- public async Task UpdateLabelPackageContentAsync(long labelPackageContentId, string content)
- {
- await ServerProxy.AdminService.UpdateLabelPackageContentAsync(_session.Id, labelPackageContentId, content);
- }
- /// <summary>
- /// Gets all label packages.
- /// </summary>
- /// <returns>Label packages from the system.</returns>
- public async Task<List<LabelPackage>> GetLabelPackagesAsync()
- {
- return await ServerProxy.AdminService.GetLabelPackagesAsync(_session.Id);
- }
- /// <summary>
- /// Gets the label packages count by keyword.
- /// </summary>
- /// <returns>Label packages count from the system.</returns>
- public async Task<int> GetLabelPackagesCountAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetLabelPackagesCountAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Gets the label packages by keyword.
- /// </summary>
- /// <returns>Label packages from the system.</returns>
- public async Task<List<LabelPackage>> GetLabelPackagesAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetLabelPackagesAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get label package content by id.
- /// </summary>
- /// <param name="labelPackageContentId">The id of the label package content.</param>
- /// <returns>The loaded label package content.</returns>
- public async Task<LabelPackageContent> GetLabelPackageContentAsync(long labelPackageContentId)
- {
- return await ServerProxy.AdminService.GetLabelPackageContentAsync(_session.Id, labelPackageContentId);
- }
- /// <summary>
- /// Delete the label package.
- /// </summary>
- /// <returns>Void</returns>
- public async Task DeleteLabelPackageAsync(long labelPackageId)
- {
- await ServerProxy.AdminService.DeleteLabelPackageAsync(_session.Id, labelPackageId);
- }
- #endregion LabelPackage
- #region CaseStatistics
- /// <summary>
- /// Get committed count.
- /// </summary>
- /// <param name="labelerId">The id of the labeler.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>The committed count.</returns>
- public async Task<int> GetLabelerCommittedCountAsync(long labelerId, DateTime start, DateTime end)
- {
- return await ServerProxy.AdminService.GetLabeledImageCountAsync(_session.Id, labelerId, start, end);
- }
- /// <summary>
- /// Get committed count.
- /// </summary>
- /// <param name="day">The day to filter.</param>
- /// <returns>The committed count.</returns>
- public async Task<int> GetDayCommittedCountAsync(DateTime day)
- {
- return await ServerProxy.AdminService.GetDayCommittedCountAsync(_session.Id, day);
- }
- /// <summary>
- /// Get committed region count.
- /// </summary>
- /// <param name="labelerId">The id of the labeler.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>Get committed region count.</returns>
- public async Task<int> GetLabelerCommittedRegionCountAsync(long labelerId, DateTime start, DateTime end)
- {
- return await ServerProxy.AdminService.GetLabeledRegionCountAsync(_session.Id, labelerId, start, end);
- }
- /// <summary>
- /// Get assigned image count.
- /// </summary>
- /// <param name="labelerId">The id of the labeler.</param>
- /// <returns>Get assigned image count.</returns>
- public async Task<int> GetLabelerAssignedImageCountAsync(long labelerId)
- {
- return await ServerProxy.AdminService.GetAssignedImageCountAsync(_session.Id, labelerId);
- }
- /// <summary>
- /// Get assigned image count.
- /// </summary>
- /// <param name="labelerId">The id of the labeler.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>Get assigned image count.</returns>
- public async Task<int> GetLabelerAssignedImageCountAsync(long labelerId, DateTime start, DateTime end)
- {
- return await ServerProxy.AdminService.GetAssignedImageCountAsync(_session.Id, labelerId, start, end);
- }
- /// <summary>
- /// Get left image count.
- /// </summary>
- /// <param name="labelerId">The id of the labeler.</param>
- /// <returns>Get left image count.</returns>
- public async Task<int> GetLabelerLeftImageCountAsync(long labelerId)
- {
- return await ServerProxy.AdminService.GetUnlabeledAssignedImageCountAsync(_session.Id, labelerId);
- }
- /// <summary>
- /// Get labeler statistic data.
- /// </summary>
- /// <param name="labelerId">The id of the labeler.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>The labeler statistic data.</returns>
- public async Task<LabelerStatisticData> GetLabelerStatisticDataAsync(long labelerId, DateTime start, DateTime end)
- {
- return await ServerProxy.AdminService.GetLabelerStatisticDataAsync(_session.Id, labelerId, start, end);
- }
- /// <summary>
- /// Get labeler statistics by case id..
- /// </summary>
- /// <param name="caseId">The id of the label case.</param>
- /// <returns>The labeler statistics.</returns>
- public async Task<LabelCaseStatistic> GetLabelCaseStatisticAsync(long caseId)
- {
- return await ServerProxy.AdminService.GetLabelCaseStatisticAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Get labeler case statistics by the same batch label case id
- /// </summary>
- /// <param name="sameBatchLabelCaseId">The same batch label case id</param>
- /// <returns></returns>
- public async Task<List<LabelCaseStatistic>> GetLabelCaseStatisticsBySameBatchLabelCaseIdAsync(long sameBatchLabelCaseId)
- {
- return await ServerProxy.AdminService.GetLabelCaseStatisticsBySameBatchLabelCaseIdAsync(_session.Id, sameBatchLabelCaseId);
- }
- /// <summary>
- /// Get SameBatchLabelCase statistics by case id..
- /// </summary>
- /// <param name="caseId">The id of the label case.</param>
- /// <returns>The SameBatchLabelCase general statistics.</returns>
- public async Task<SameBatchLabelCaseStatisticData> GetSameBatchLabelCaseStatisticsAsync(long caseId)
- {
- return await ServerProxy.AdminService.GetSameBatchLabelCaseStatisticsAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Get all the SameBatchLabelCase.
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched keyword.</param>
- /// <param name="start">The start time.</param>
- /// <param name="end">The end time.</param>
- /// <returns>The loaded SameBatchLabelCase.</returns>
- public async Task<List<SameBatchLabelCase>> GetSameBatchLabelCasesAsync(int pageIndex, int pageSize, long organizationId, long imageCategoryId, string keyword, DateTime start = new DateTime(), DateTime end = new DateTime(), DateTime updateStart = new DateTime(), DateTime updateEnd = new DateTime())
- {
- return await ServerProxy.AdminService.GetSameBatchLabelCasesAsync(_session.Id, pageIndex, pageSize, organizationId, imageCategoryId, keyword, start, end, updateStart, updateEnd);
- }
- /// <summary>
- /// Get all the SameBatchLabelCase.
- /// </summary>
- /// <returns>The loaded SameBatchLabelCase.</returns>
- public async Task<List<SameBatchLabelCase>> GetSameBatchLabelCasesAsync()
- {
- return await ServerProxy.AdminService.GetSameBatchLabelCasesAsync(_session.Id);
- }
- /// <summary>
- /// Get the SameBatchLabelCases.
- /// </summary>
- /// <param name="id">The same batch label case id.</param>
- /// <returns>The loaded SameBatchLabelCase.</returns>
- public async Task<SameBatchLabelCase> GetSameBatchLabelCaseAsync(long id)
- {
- return await ServerProxy.AdminService.GetSameBatchLabelCaseAsync(_session.Id, id);
- }
- /// <summary>
- /// Assign conflict labeled data to Senior labelers.
- /// </summary>
- /// <returns></returns>
- public async Task AssignConflictLabeledDataAsync()
- {
- await ServerProxy.AdminService.AssignConflictLabeledDataAsync(_session.Id);
- }
- #endregion CaseStatistics
- #region agents
- /// <summary>
- /// Get all online and registered agents.
- /// </summary>
- /// <returns>The agents.</returns>
- public async Task<List<AgentInfoEx>> GetAgentsAsync()
- {
- return await ServerProxy.AdminService.GetAgentsAsync(_session.Id);
- }
- /// <summary>
- /// Get the agents count from the system.
- /// </summary>
- /// <returns>Void</returns>
- public async Task<int> GetAgentsCountAsync()
- {
- return await ServerProxy.AdminService.GetAgentsCountAsync(_session.Id);
- }
- /// <summary>
- /// Register an agent into the system.
- /// </summary>
- /// <param name="agentVersion">The version of the agent</param>
- /// <param name="agentName">The name of the agent.</param>
- /// <param name="description">The description of the agent.</param>
- /// <param name="hardwareCode">The hardware code of the agent.</param>
- /// <param name="ipAddress">The ip address of the agent.</param>
- /// <returns></returns>
- public async Task RegisterAgentAsync(string agentVersion, string agentName, string description, string hardwareCode, string ipAddress, List<EntityBase> organizations)
- {
- await ServerProxy.AdminService.RegisterAgentAsync(_session.Id, agentVersion, agentName, description, hardwareCode, ipAddress, organizations);
- }
- /// <summary>
- /// UnRegister an agent from the system.
- /// </summary>
- /// <param name="agentId">The agentId to un-register.</param>
- /// <returns></returns>
- public async Task UnRegisterAgentAsync(long agentId)
- {
- await ServerProxy.AdminService.UnRegisterAgentAsync(_session.Id, agentId);
- }
- /// <summary>
- /// Update agent organizations from the system.
- /// </summary>
- /// <param name="sessionId">The session id of the admin.</param>
- /// <param name="agentId">The agent id</param>
- /// <param name="organizations">The organizations to update</param>
- /// <returns>Void</returns>
- public async Task UpdateAgentOrganizationsAsync(long agentId, List<EntityBase> organizations)
- {
- await ServerProxy.AdminService.UpdateAgentOrganizationsAsync(_session.Id, agentId, organizations);
- }
- #endregion agents
- #region logs
- /// <summary>
- /// Get log item count.
- /// </summary>
- /// <returns>The log item count.</returns>
- public async Task<int> GetLogItemCountAsync()
- {
- return await ServerProxy.AdminService.GetLogItemCountAsync(_session.Id);
- }
- /// <summary>
- /// Get log items.
- /// </summary>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">Items per page.</param>
- /// <returns></returns>
- public async Task<List<LogItem>> GetLogItemsAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetLogItemsAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- #endregion logs
- #region labeler client
- /// <summary>
- /// Get all labeler client infos count.
- /// </summary>
- /// <returns>All labeler client infos count.</returns>
- public async Task<int> GetLabelerClientInfosCountAsync()
- {
- return await ServerProxy.AdminService.GetLabelerClientInfosCountAsync(_session.Id);
- }
- /// <summary>
- /// Get all labeler client infos.
- /// </summary>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">Items per page.</param>
- /// <returns></returns>
- public async Task<List<ClientUpgradeInfo>> GetLabelerClientInfosAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetLabelerClientInfosAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Delete one labeler client info
- /// </summary>
- /// <param name="id">The labeler client info to delete.</param>
- /// <returns></returns>
- public async Task DeleteLabelerClientInfoAsync(long id)
- {
- await ServerProxy.AdminService.DeleteLabelerClientInfoAsync(_session.Id, id);
- }
- /// <summary>
- /// Add one labeler client.
- /// </summary>
- /// <param name="version">The version of labeler client.</param>
- /// <param name="description">The description of labeler client.</param>
- /// <param name="clientData">The data of the labeler client.</param>
- /// <param name="isDefault">True set to default.</param>
- /// <returns></returns>
- public async Task AddLabelerClientAsync(string fileName, string version, string description, byte[] clientData)
- {
- await ServerProxy.AdminService.AddLabelerClientAsync(_session.Id, fileName, version, description, clientData);
- }
- /// <summary>
- /// Set labeler client to default one.
- /// </summary>
- /// <param name="labelerClientInfoId">The id of the labeler client info</param>
- /// <returns></returns>
- public async Task SetDefaultLabelerClientInfoAsync(long labelerClientInfoId)
- {
- await ServerProxy.AdminService.SetDefaultLabelerClientAsync(_session.Id, labelerClientInfoId);
- }
- #endregion labeler client
- #region CaseAssignment
- /// <summary>
- /// Get ths labeler group
- /// </summary>
- /// <param name="imageCategoryId">The image category id</param>
- /// <param name="labelerId">The labeler id</param>
- /// <returns></returns>
- public async Task<LabelerGroup> GetLabelerGroupAsync(long imageCategoryId, long labelerId)
- {
- return await ServerProxy.AdminService.GetLabelerGroupAsync(_session.Id, imageCategoryId, labelerId);
- }
- /// <summary>
- /// Get the sum of the assigned count of AssignedLabelCase.
- /// </summary>
- /// <param name="imageCategoryId">The image category id</param>
- /// <param name="labelerId">The labeler id</param>
- /// <returns></returns>
- public async Task<QuantityBase> GetAssignedCountForAssignedLabelCaseAsync(long imageCategoryId, long labelerId)
- {
- return await ServerProxy.AdminService.GetAssignedCountForAssignedLabelCaseAsync(_session.Id, imageCategoryId, labelerId);
- }
- /// <summary>
- /// Get the sum of the assigned ultrasound file count.
- /// </summary>
- /// <returns></returns>
- public async Task<int> GetAssignedUltrasoundFileCountAsync(long imageBatchId, AssignCondition condition, int assignGroupCount)
- {
- return await ServerProxy.AdminService.GetAssignedUltrasoundFileCountAsync(_session.Id, imageBatchId, condition, assignGroupCount);
- }
- /// <summary>
- /// Assign files to labelers.
- /// </summary>
- /// <param name="caseName">The label case name.</param>
- /// <param name="organization">The organization of label case.</param>
- /// <param name="imageCategoryId">The tag id of the images.</param>
- /// <param name="labelerInfos">The labelers to assign.</param>
- /// <param name="mode">The assign mode.</param>
- /// <param name="type">The assign type.</param>
- /// <param name="condition">The assign condition.</param>
- /// <param name="assignCount">The image count to assign.</param>
- /// <returns>The assign operation id.</returns>
- public async Task<OpResult> AssignLabelCaseAsync(long operationId, string caseName, EntityBase organization, long imageCategoryId, long imageBatchId, IEnumerable<AssignLabelerInfoModal> labelerInfos,
- AssignMode mode, AssignType type, AssignCondition condition, QuantityBase assignCount, VideoItem videoItem)
- {
- return await ServerProxy.AdminService.AssignLabelCaseAsync(_session.Id, operationId, caseName, organization, imageCategoryId, imageBatchId, labelerInfos, mode, type, condition, assignCount, videoItem);
- }
- /// <summary>
- /// Assign files to labelers.
- /// </summary>
- /// <param name="caseName">The label case name.</param>
- /// <param name="organization">The organization of label case.</param>
- /// <param name="imageCategoryId">The tag id of the images.</param>
- /// <param name="labelerInfos">The labelers to assign.</param>
- /// <param name="mode">The assign mode.</param>
- /// <param name="type">The assign type.</param>
- /// <param name="condition">The assign condition.</param>
- /// <param name="assignCount">The image count to assign.</param>
- /// <returns>The assign operation id.</returns>
- public async Task<long> AssignDisputeLabelCaseAsync(string caseName, EntityBase organization, long imageCategoryId, long imageBatchId, List<SameBatchLabelerInfo> labelerInfos, AssignMode mode,
- AssignType type, List<long> ultrasoundId)
- {
- return await ServerProxy.AdminService.AssignDisputeLabelCaseAsync(_session.Id, caseName, organization, imageCategoryId, imageBatchId, labelerInfos, mode, type, ultrasoundId);
- }
- /// <summary>
- /// Assign label files to labelers for relabeled.
- /// </summary>
- /// <param name="caseName">The label case name.</param>
- /// <param name="sameBatchLabelCaseId">The same batch label case id.</param>
- /// <param name="assignedLabelCaseId">The assigned label case id.</param>
- /// <returns>The assign operation id.</returns>
- public async Task<long> AssignRelabelCaseAsync(string caseName, long sameBatchLabelCaseId, long assignedLabelCaseId, EntityBase imageBatch)
- {
- return await ServerProxy.AdminService.AssignRelabelCaseAsync(_session.Id, caseName, sameBatchLabelCaseId, assignedLabelCaseId, imageBatch);
- }
- /// <summary>
- /// Assign labeled files to reviewers.
- /// </summary>
- /// <param name="sameBatchLabelCaseId"></param>
- /// <param name="reviewers">The labelers to review.</param>
- /// <returns></returns>
- public async Task<long> AssignReviewCaseAsync(long sameBatchLabelCaseId, List<EntityBase> reviewers, List<AssignReviewInfo> assignReviewInfos, bool isHideLabelerName, bool isHideReviewerName)
- {
- return await ServerProxy.AdminService.AssignReviewCaseAsync(_session.Id, sameBatchLabelCaseId, reviewers, assignReviewInfos, isHideLabelerName, isHideReviewerName);
- }
- /// <summary>
- /// Assign questioned label files to labeler.
- /// </summary>
- /// <param name="caseName">The label case name.</param>
- /// <param name="organization">The organization of label case.</param>
- /// <param name="imageCategoryId">The image category id.</param>
- /// <returns>The assign operation id.</returns>
- public async Task<long> AssignQuestionedFilesAsync(EntityBase organization, long imageCategoryId, long imageBatchId, List<EntityBase> labelers, List<AssignQuestionCaseViewModel> assignQuestionCaseViews)
- {
- return await ServerProxy.AdminService.AssignQuestionedFilesEachAsync(_session.Id, organization, imageCategoryId, imageBatchId, labelers, assignQuestionCaseViews);
- }
- /// <summary>
- /// Get the progress of the assign operation.
- /// </summary>
- /// <param name="assignId">The id of the assign operation.</param>
- /// <returns>The progress of the assign operation.</returns>
- public async Task<int> GetAssignImagesProgressAsync(long assignId)
- {
- return await ServerProxy.AdminService.GetAssignImagesProgressAsync(_session.Id, assignId);
- }
- /// <summary>
- /// Assign label case to labelers again.
- /// </summary>
- /// <param name="sameBatchLabelCaseId">The same batch label case id.</param>
- /// <param name="labelers">The labelers.</param>
- /// <returns></returns>
- public async Task<long> AssignLabelCaseAgainAsync(long sameBatchLabelCaseId, List<EntityBase> labelers)
- {
- return await ServerProxy.AdminService.AssignLabelCaseAgainAsync(_session.Id, sameBatchLabelCaseId, labelers);
- }
- /// <summary>
- /// Update same batch label case
- /// </summary>
- /// <param name="id">The id of SameBatchLabelCase.</param>
- /// <param name="isHideLabelerName">Whether to hide Labeler Name.</param>
- /// <returns></returns>
- public async Task UpdateSameBatchLabelCaseAsync(long id, bool isHideLabelerName, bool isHideReviewerName)
- {
- await ServerProxy.AdminService.UpdateSameBatchLabelCaseAsync(_session.Id, id, isHideLabelerName, isHideReviewerName);
- }
- /// <summary>
- /// Set label case to unadoptable
- /// </summary>
- /// <param name="sameBatchLabelCase">The updated SameBatchLabelCase.</param>
- /// <returns></returns>
- public async Task SetSameBatchLabelCaseToUnAdoptableAsync(SameBatchLabelCase sameBatchLabelCase)
- {
- await ServerProxy.AdminService.SetSameBatchLabelCaseToUnAdoptableAsync(_session.Id, sameBatchLabelCase);
- }
- /// <summary>
- /// Clear labeled files
- /// </summary>
- /// <param name="sameBatchLabelCaseId">The same batch label case id.</param>
- /// <returns></returns>
- public async Task ClearLabeledFilesAsync(long sameBatchLabelCaseId)
- {
- await ServerProxy.AdminService.ClearLabeledFilesAsync(_session.Id, sameBatchLabelCaseId);
- }
- public async Task<List<AssignQuestionCaseViewModel>> GetQusetionInfoByBatchId(long batchId)
- {
- return await ServerProxy.AdminService.GetQusetionInfoByBatchId(_session.Id, batchId);
- }
- #endregion CaseAssignment
- #region Reviewer Client
- /// <summary>
- /// Add one reviewer client.
- /// </summary>
- /// <param name="version">The version of reviewer client.</param>
- /// <param name="description">The description of reviewer client.</param>
- /// <param name="clientData">The data of the reviewer client.</param>
- /// <returns></returns>
- public async Task AddReviewerClientAsync(string fileName, string version, string description, byte[] clientData)
- {
- await ServerProxy.AdminService.AddReviewerClientAsync(_session.Id, fileName, version, description, clientData);
- }
- /// <summary>
- /// Get the reviewer client infos.
- /// </summary>
- /// <returns>The found reviewer client infos.</returns>
- public async Task<List<ClientUpgradeInfo>> GetReviewerClientInfosAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetReviewerClientInfosAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get all reviewer client infos count.
- /// </summary>
- /// <returns>All reviewer client infos count.</returns>
- public async Task<int> GetReviewerClientInfosCountAsync()
- {
- return await ServerProxy.AdminService.GetReviewerClientInfosCountAsync(_session.Id);
- }
- /// <summary>
- /// Set reviewer client to default one.
- /// </summary>
- /// <param name="reviewerClientInfoId">The id of the reviewer client info</param>
- /// <returns></returns>
- public async Task SetDefaultReviewerClientInfoAsync(long reviewerClientInfoId)
- {
- await ServerProxy.AdminService.SetDefaultReviewerClientAsync(_session.Id, reviewerClientInfoId);
- }
- /// <summary>
- /// Delete one reviewer client info
- /// </summary>
- /// <returns></returns>
- public async Task DeleteReviewerClientInfoAsync(long id)
- {
- await ServerProxy.AdminService.DeleteReviewerClientInfoAsync(_session.Id, id);
- }
- #endregion Reviewer Client
- #region Train Tasks
- /// <summary>
- /// Get the train tasks count by keyword.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The searched train tasks count.</returns>
- public async Task<int> GetTrainTasksCountAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetTrainTasksCountAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Gets the train tasks by keyword.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The searched train tasks.</returns>
- public async Task<List<TrainTaskModel>> GetTrainTasksAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetTrainTasksAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Cancel train task.
- /// </summary>
- /// <param name="trainTaskId">The id of the train task.</param>
- /// <returns></returns>
- public async Task CancelTrainTaskAsync(long trainTaskId)
- {
- await ServerProxy.AdminService.CancelTrainTaskAsync(_session.Id, trainTaskId);
- }
- /// <summary>
- /// Delete a train task from the system.
- /// </summary>
- /// <param name="trainTaskId">The id of the train task to be deleted.</param>
- /// <returns>Void</returns>
- public async Task DeleteTrainTaskAsync(long trainTaskId)
- {
- await ServerProxy.AdminService.DeleteTrainTaskAsync(_session.Id, trainTaskId);
- }
- #endregion Train Tasks
- #region CaseAdjustment
- /// <summary>
- /// Get the label cases which assigned to a labeler.
- /// </summary>
- /// <param name="labelerId">The id of the labeler</param>
- /// <returns>The cases</returns>
- public async Task<List<AssignedLabelCase>> GetAssignedLabelCasesByLabelerIdAsync(long labelerId, int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetAssignedLabelCasesByLabelerIdAsync(_session.Id, labelerId, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get all assignedLabelCases count of one labeler.
- /// </summary>
- /// <param name="labelerId">The labelerId which the cases assigned to.</param>
- /// <returns>The assigned label case count.</returns>
- public async Task<int> GetAssignedLabelCaseCountAsync(long labelerId, string keyword)
- {
- return await ServerProxy.AdminService.GetAssignedLabelCaseCountAsync(_session.Id, labelerId, keyword);
- }
- /// <summary>
- /// Delete the label case by case id.
- /// </summary>
- /// <param name="caseId">The id of the case.</param>
- /// <returns>Void</returns>
- public async Task DeleteLabelCaseAsync(long caseId)
- {
- await ServerProxy.AdminService.DeleteLabelCaseAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Move up the label case by case id.
- /// </summary>
- /// <param name="caseId">The id of the case.</param>
- /// <returns>Void</returns>
- public async Task MoveUpLabelCaseAsync(long caseId)
- {
- await ServerProxy.AdminService.MoveUpLabelCaseAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Move down the label case by case id.
- /// </summary>
- /// <param name="caseId">The id of the case.</param>
- /// <returns>Void</returns>
- public async Task MoveDownLabelCaseAsync(long caseId)
- {
- await ServerProxy.AdminService.MoveDownLabelCaseAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Get the cases which assigned to a reviewer.
- /// </summary>
- /// <param name="reviewerId">The id of the reviewer</param>
- /// <returns>The cases</returns>
- public async Task<List<AssignedReviewCase>> GetAssignedReviewCasesByReviewerIdAsync(long reviewerId, int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetAssignedReviewCasesByReviewerIdAsync(_session.Id, reviewerId, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get all assignedReviewCases count of one reviewer.
- /// </summary>
- /// <param name="reviewerId">The reviewerId which the cases assigned to.</param>
- /// <returns>The assigned review case count.</returns>
- public async Task<int> GetAssignedReviewCaseCountAsync(long reviewerId, string keyword)
- {
- return await ServerProxy.AdminService.GetAssignedReviewCaseCountAsync(_session.Id, reviewerId, keyword);
- }
- /// <summary>
- /// Delete the review case by case id.
- /// </summary>
- /// <param name="caseId">The id of the review case.</param>
- /// <returns>Void</returns>
- public async Task DeleteReviewCaseAsync(long caseId)
- {
- await ServerProxy.AdminService.DeleteReviewCaseAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Move up the review case by case id.
- /// </summary>
- /// <param name="caseId">The id of the review case.</param>
- /// <returns>Void</returns>
- public async Task MoveUpReviewCaseAsync(long caseId)
- {
- await ServerProxy.AdminService.MoveUpReviewCaseAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Move down the review case by case id.
- /// </summary>
- /// <param name="caseId">The id of the review case.</param>
- /// <returns>Void</returns>
- public async Task MoveDownReviewCaseAsync(long caseId)
- {
- await ServerProxy.AdminService.MoveDownReviewCaseAsync(_session.Id, caseId);
- }
- /// <summary>
- /// Relabel and reassign label case to labeler.
- /// </summary>
- /// <param name="caseName">The same batch label case name.</param>
- /// <param name="labeler">The labeler.</param>
- /// <param name="isHideReviewerName">The value to indicate whether the labeler client hide reviewer name.</param>
- /// <param name="sourceAssignedLabelCaseId">The source assign label case id.</param>
- /// <returns></returns>
- public async Task<long> RelabelReassignedLabelCaseAsync(string caseName, EntityBase labeler, bool isHideReviewerName, long organizationId, long imageCategoryId, long imageCaseId, long sourceAssignedLabelCaseId, List<long> LabeledUltrasoundFileId = null, long reLabelRecordId = 0, long reLabelRecordCountId = 0)
- {
- return await ServerProxy.AdminService.RelabelReassignedLabelCaseAsync(_session.Id, caseName, labeler, isHideReviewerName, organizationId, imageCategoryId, imageCaseId, sourceAssignedLabelCaseId, LabeledUltrasoundFileId, reLabelRecordId, reLabelRecordCountId);
- }
- /// <summary>
- /// 重新分配审核人员
- /// </summary>
- /// <param name="assignedLabelCaseId"></param>
- /// <param name="laberUltrasoundFileIds"></param>
- /// <param name="reviewer"></param>
- /// <param name="ImageCategoryId"></param>
- /// <param name="reLabelRecordCountId"></param>
- /// <param name="reLabelRecordId"></param>
- /// <returns></returns>
- public async Task ReAssignReviewCaseAsync(long assignedLabelCaseId, List<long> laberUltrasoundFileIds, EntityBase reviewer, long ImageCategoryId, long reLabelRecordCountId, long reLabelRecordId)
- {
- await ServerProxy.AdminService.ReAssignReviewCaseAsync(_session.Id, assignedLabelCaseId, laberUltrasoundFileIds, reviewer, ImageCategoryId, reLabelRecordCountId, reLabelRecordId);
- }
- #endregion CaseAdjustment
- #region LabelerStatistics
- /// <summary>
- /// Get labelers' label statistics.
- /// </summary>
- /// <param name="start">The start time</param>
- /// <param name="end">The end time</param>
- /// <returns>The labelers' label statistics.</returns>
- public async Task<List<LabelerLabelStatistic>> GetLabelerStatisticsAsync(int pageIndex, int pageSize, string keyword, long organizationId, long imageCategoryId, DateTime start, DateTime end)
- {
- return await ServerProxy.AdminService.GetLabelerStatisticsAsync(_session.Id, pageIndex, pageSize, keyword, organizationId, imageCategoryId, start, end);
- }
- /// <summary>
- /// Get labelers' label Groups count.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The labelers' label Groups count</returns>
- public async Task<int> GetLabelerGroupsCountAsync(string keyword, long organizationId, long imageCategoryId)
- {
- return await ServerProxy.AdminService.GetLabelerGroupsCountAsync(_session.Id, keyword, organizationId, imageCategoryId);
- }
- #endregion LabelerStatistics
- #region Developer Client
- /// <summary>
- /// Add one developer client.
- /// </summary>
- /// <param name="version">The version of developer client.</param>
- /// <param name="description">The description of developer client.</param>
- /// <param name="clientData">The data of the developer client.</param>
- /// <returns></returns>
- public async Task AddDeveloperClientAsync(string fileName, string version, string description, byte[] clientData)
- {
- await ServerProxy.AdminService.AddDeveloperClientAsync(_session.Id, fileName, version, description, clientData);
- }
- /// <summary>
- /// Get the developer client infos.
- /// </summary>
- /// <returns>The found developer client infos.</returns>
- public async Task<List<ClientUpgradeInfo>> GetDeveloperClientInfosAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetDeveloperClientInfosAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get all developer client infos count.
- /// </summary>
- /// <returns>All developer client infos count.</returns>
- public async Task<int> GetDeveloperClientInfosCountAsync()
- {
- return await ServerProxy.AdminService.GetDeveloperClientInfosCountAsync(_session.Id);
- }
- /// <summary>
- /// Set developer client to default one.
- /// </summary>
- /// <param name="developerClientInfoId">The id of the developer client info</param>
- /// <returns></returns>
- public async Task SetDefaultDeveloperClientInfoAsync(long developerClientInfoId)
- {
- await ServerProxy.AdminService.SetDefaultDeveloperClientAsync(_session.Id, developerClientInfoId);
- }
- /// <summary>
- /// Delete one developer client info
- /// </summary>
- /// <param name="id">The developer client info to delete.</param>
- /// <returns></returns>
- public async Task DeleteDeveloperClientInfoAsync(long id)
- {
- await ServerProxy.AdminService.DeleteDeveloperClientInfoAsync(_session.Id, id);
- }
- #endregion Developer Client
- #region Authority
- /// <summary>
- /// Get all authority menus from system
- /// </summary>
- /// <returns></returns>
- public async Task<List<AuthorityMenu>> GetAuthorityMenusAsync()
- {
- return await ServerProxy.AdminService.GetAuthorityMenusAsync(_session.Id);
- }
- /// <summary>
- /// Get defaulr authorities
- /// </summary>
- /// <returns></returns>
- public async Task<List<AuthorityMenu>> GetDefaultAuthorityMenusAsync()
- {
- return await ServerProxy.AdminService.GetDefaultAuthorityMenusAsync(_session.Id);
- }
- #endregion Authority
- #region image category
- /// <summary>
- /// Create a image category.
- /// </summary>
- /// <returns></returns>
- public async Task<ImageCategory> CreateImageCategoryAsync(string name, CategoryLevel level, EntityBase parent, long organizatinId, long labelPackageContentId, long sameBatchLabelCaseId)
- {
- return await ServerProxy.AdminService.CreateImageCategoryAsync(_session.Id, name, level, parent, organizatinId, labelPackageContentId, sameBatchLabelCaseId);
- }
- /// <summary>
- /// Delete a image category.
- /// </summary>
- /// <returns>Void</returns>
- public async Task DeleteImageCategoryAsync(long id)
- {
- await ServerProxy.AdminService.DeleteImageCategoryAsync(_session.Id, id);
- }
- /// <summary>
- /// Get the image category by id.
- /// </summary>
- /// <param name="id">The searched id.</param>
- /// <returns>The loaded image category.</returns>
- public async Task<ImageCategory> GetImageCategoryAsync(long id)
- {
- return await ServerProxy.AdminService.GetImageCategoryAsync(_session.Id, id);
- }
- /// <summary>
- /// Get the image categories count by keyword.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The found image categories count.</returns>
- public async Task<int> GetImageCategoriesCountAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetImageCategoriesCountAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Get the image categories by keyword.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The loaded image categories.</returns>
- public async Task<List<ImageCategory>> GetImageCategoriesAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetImageCategoriesAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get all image categories.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The loaded image categories.</returns>
- public async Task<List<ImageCategory>> GetImageCategoriesAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetImageCategoriesAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Get the image categories by parent id.
- /// </summary>
- /// <param name="parentId">The searched parent id.</param>
- /// <returns>The loaded image categories.</returns>
- public async Task<List<ImageCategory>> GetImageCategoriesByParentIdAsync(long parentId)
- {
- return await ServerProxy.AdminService.GetImageCategoriesByParentIdAsync(_session.Id, parentId);
- }
- /// <summary>
- /// Get the image categories by category level.
- /// </summary>
- /// <param name="level">The searched category level.</param>
- /// <returns>The loaded image categories.</returns>
- public async Task<List<ImageCategory>> GetImageCategoriesByLevelAsync(CategoryLevel level)
- {
- return await ServerProxy.AdminService.GetImageCategoriesByLevelAsync(_session.Id, level);
- }
- /// <summary>
- /// Get the cases of image categories by parent id.
- /// </summary>
- /// <param name="parentId">The searched parent id.</param>
- /// <returns>The loaded image categories.</returns>
- public async Task<List<ImageCategory>> GetImageCategoriesWithRelabeledCaseByParentIdAsync(long parentId)
- {
- return await ServerProxy.AdminService.GetImageCategoriesWithRelabeledCaseByParentIdAsync(_session.Id, parentId);
- }
- /// <summary>
- /// Get the image categories by labelPackageId.
- /// </summary>
- /// <param name="labelPackageContentId">The label package content id.</param>
- /// <returns>The loaded ImageCategories</returns>
- public async Task<List<ImageCategory>> GetImageCategoriesHasChildrenAsync(long labelPackageContentId)
- {
- return await ServerProxy.AdminService.GetImageCategoriesHasChildrenAsync(_session.Id, labelPackageContentId);
- }
- /// <summary>
- /// Update the image category hasChildren in system.
- /// </summary>
- /// <returns></returns>
- public async Task UpdateImageCategoryHasChildrenAsync(long id, bool hasChildren)
- {
- await ServerProxy.AdminService.UpdateImageCategoryHasChildrenAsync(_session.Id, id, hasChildren);
- }
- /// <summary>
- /// Update the image category that assigned users in system.
- /// </summary>
- /// <returns></returns>
- public async Task UpdateImageCategoryUsersAsync(long id, AccountType accountType, List<EntityBase> users)
- {
- await ServerProxy.AdminService.UpdateImageCategoryUsersAsync(_session.Id, id, accountType, users);
- }
- /// <summary>
- /// Update the image category gold standard and self-check image quantity item in system.
- /// </summary>
- /// <returns></returns>
- public async Task UpdateImageCategoryGoldStandardAndSelfCheckQuantityItemAsync(long id, double goldStandardProportion, int goldStandardQualifiedPeople, double selfCheckProportion, bool isSupportedSkipFrame, VideoItem videoItem, DifficultyLevel difficultyLevel)
- {
- await ServerProxy.AdminService.UpdateImageCategoryGoldStandardAndSelfCheckQuantityItemAsync(_session.Id, id, goldStandardProportion, goldStandardQualifiedPeople, selfCheckProportion, isSupportedSkipFrame, videoItem, difficultyLevel);
- }
- #endregion image category
- #region Developer share info
- /// <summary>
- /// Gets the developer share infos by keyword.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The loaded developer share infos.</returns>
- public async Task<List<DeveloperShareInfo>> GetDeveloperShareInfosAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetDeveloperShareInfosAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Gets the developer share infos count by keyword.
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The loaded developer share infos count.</returns>
- public async Task<int> GetDeveloperShareInfosCountAsync(string keyword)
- {
- return await ServerProxy.AdminService.GetDeveloperShareInfosCountAsync(_session.Id, keyword);
- }
- /// <summary>
- /// Update shared developer folder
- /// </summary>
- /// <param name="state">The approval state</param>
- /// <returns></returns>
- public async Task UpdateSharedDeveloperFolderAsync(long id, ApprovalState state)
- {
- await ServerProxy.AdminService.UpdateSharedDeveloperFolderAsync(_session.Id, id, state);
- }
- #endregion Developer share info
- #region treating process
- /// <summary>
- /// get treating process by ultrasoundid
- /// </summary>
- /// <param name="ultrasoundId"></param>
- /// <returns></returns>
- public async Task<TreatingProcess> GetTreatingProcessByultrasoundId(long ultrasoundId)
- {
- return await ServerProxy.AdminService.GetTreatingProcessByultrasoundId(_session.Id, ultrasoundId);
- }
- #endregion treating process
- #region ReLabelRecord
- public async Task<List<ReLabelRecord>> GetReLabelRecordBySameBatchLabelCaseId(long SameBatchLabelCaseId)
- {
- return await ServerProxy.AdminService.GetReLabelRecordBySameBatchLabelCaseId(_session.Id, SameBatchLabelCaseId);
- }
- #endregion ReLabelRecord
- #region 呼吸机数据管理
- /// <summary>
- /// Add un-labeled Ventilator file into the system.
- /// </summary>
- /// <returns>Void</returns>
- public async Task<VentilatorOpResult> AddUnLabeledVentilatorFileAsync(long organizationId, VentilatorFile ventilatorFile, byte[] fileData, string fileName)
- {
- return await ServerProxy.AdminService.AddUnLabeledVentilatorFileAsync(_session.Id, organizationId, ventilatorFile, fileData, fileName);
- }
- /// <summary>
- /// Upload un-labeled Ventilator file into the system.
- /// </summary>
- /// <returns>Void</returns>
- public async Task<OpResult> UploadUnLabeledVentilatorFileAsync(VentilatorFile ventilatorFile)
- {
- return await ServerProxy.AdminService.UploadUnLabeledVentilatorFileAsync(_session.Id, ventilatorFile);
- }
- /// <summary>
- /// 获取呼吸文件数量
- /// </summary>
- /// <returns></returns>
- public async Task<int> GetVentilatorFilesCountAsync(SearchVentilatorFileModel searchModel)
- {
- return await ServerProxy.AdminService.GetVentilatorFilesCountAsync(_session.Id, searchModel);
- }
- /// <summary>
- /// 获取呼吸文件.
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// </summary>
- public async Task<List<VentilatorFile>> GetVentilatorFilesAsync(int pageIndex, int pageSize, SearchVentilatorFileModel searchModel)
- {
- return await ServerProxy.AdminService.GetVentilatorFilesAsync(_session.Id, pageIndex, pageSize, searchModel);
- }
- /// <summary>
- /// 获取呼吸文件.
- /// </summary>
- /// <param name="ventilatorId"></param>
- /// <returns></returns>
- public async Task<VentilatorFile> GetVentilatorFileByIdAsync(long ventilatorId)
- {
- return await ServerProxy.AdminService.GetVentilatorFileByIdAsync(_session.Id, ventilatorId);
- }
- /// <summary>
- /// 更新呼吸文件
- /// </summary>
- /// <returns></returns>
- public async Task UpdateVentilatorFileByIdAsync(VentilatorFile ventilatorFile)
- {
- await ServerProxy.AdminService.UpdateVentilatorFileByIdAsync(_session.Id, ventilatorFile);
- }
- /// <summary>
- /// Download the Ventilator Files
- /// </summary>
- /// <param name="ventilatorIdList"></param>
- /// <param name="deviceParameterList"></param>
- /// <returns></returns>
- public async Task<byte[]> DownloadVentilatorFilesAsync(List<long> ventilatorIdList, List<DeviceParameter> deviceParameterList)
- {
- return await ServerProxy.AdminService.DownloadVentilatorFilesAsync(_session.Id, ventilatorIdList, deviceParameterList);
- }
- /// <summary>
- /// Get the VentilatorFileVersion count.
- /// </summary>
- /// <returns>The count of the VentilatorFileVersion.</returns>
- public async Task<int> GetVentilatorFileVersionCountAsync(long ventilatorFileId)
- {
- return await ServerProxy.AdminService.GetVentilatorFileVersionCountAsync(_session.Id, ventilatorFileId);
- }
- /// <summary>
- /// Get VentilatorFileVersion items.
- /// </summary>
- /// <param name="pageIndex">The index of the page.</param>
- /// <param name="pageSize">The size of the page.</param>
- /// <returns>The loaded VentilatorFileVersions</returns>
- public async Task<List<VentilatorFileVersion>> GetVentilatorFileVersionsAsync(long ventilatorFileId, int pageIndex, int pageSize)
- {
- return await ServerProxy.AdminService.GetVentilatorFileVersionsAsync(_session.Id, ventilatorFileId, pageIndex, pageSize);
- }
- /// <summary>
- /// Delete VentilatorFile by Id
- /// </summary>
- /// <param name="ventilatorFileId"></param>
- /// <returns></returns>
- public async Task DeleteVentilatorFileByIdAsync(long ventilatorFileId)
- {
- await ServerProxy.AdminService.DeleteVentilatorFileByIdAsync(_session.Id, ventilatorFileId);
- }
- /// <summary>
- /// Sync the Ventilator Files
- /// </summary>
- /// <returns></returns>
- public async Task<OpResult> SyncVentilatorFilesAsync(long organizationId)
- {
- return await ServerProxy.AdminService.SyncVentilatorFilesAsync(_session.Id, organizationId);
- }
- /// <summary>
- /// 获取呼吸机参数信息
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public async Task<VentilatorParameterInfo> GetVentilatorParameterInfoByIdAsync(long id)
- {
- return await ServerProxy.AdminService.GetVentilatorParameterInfoByIdAsync(_session.Id, id);
- }
- #endregion 呼吸机数据管理
- #region HandyTool Client
- /// <summary>
- /// Add one HandyTool client.
- /// </summary>
- /// <param name="version">The version of HandyTool client.</param>
- /// <param name="description">The description of HandyTool client.</param>
- /// <param name="clientData">The data of the HandyTool client.</param>
- /// <returns></returns>
- public async Task AddHandyToolClientAsync(string fileName, string version, string description, byte[] clientData)
- {
- await ServerProxy.AdminService.AddHandyToolClientAsync(_session.Id, fileName, version, description, clientData);
- }
- /// <summary>
- /// Get the HandyTool client infos.
- /// </summary>
- /// <returns>The found HandyTool client infos.</returns>
- public async Task<List<ClientUpgradeInfo>> GetHandyToolClientInfosAsync(int pageIndex, int pageSize, string keyword)
- {
- return await ServerProxy.AdminService.GetHandyToolClientInfosAsync(_session.Id, pageIndex, pageSize, keyword);
- }
- /// <summary>
- /// Get all HandyTool client infos count.
- /// </summary>
- /// <returns>All HandyTool client infos count.</returns>
- public async Task<int> GetHandyToolClientInfosCountAsync()
- {
- return await ServerProxy.AdminService.GetHandyToolClientInfosCountAsync(_session.Id);
- }
- /// <summary>
- /// Set HandyTool client to default one.
- /// </summary>
- /// <param name="HandyToolClientInfoId">The id of the HandyTool client info</param>
- /// <returns></returns>
- public async Task SetDefaultHandyToolClientInfoAsync(long HandyToolClientInfoId)
- {
- await ServerProxy.AdminService.SetDefaultHandyToolClientAsync(_session.Id, HandyToolClientInfoId);
- }
- /// <summary>
- /// Delete one HandyTool client info
- /// </summary>
- /// <returns></returns>
- public async Task DeleteHandyToolClientInfoAsync(long id)
- {
- await ServerProxy.AdminService.DeleteHandyToolClientInfoAsync(_session.Id, id);
- }
- #endregion HandyTool Client
- #region GatherCategory
- /// <summary>
- /// Create Gather Category
- /// </summary>
- /// <returns></returns>
- public async Task CreateGatherCategoryAsync(string name, EntityBase organziation, List<EntityBase> gatherers)
- {
- await ServerProxy.AdminService.CreateGatherCategoryAsync(_session.Id, name, organziation, gatherers);
- }
- /// <summary>
- /// Update Gather Category
- /// </summary>
- /// <returns></returns>
- public async Task UpdateGatherCategoryAsync(long id, string name, List<EntityBase> gatherers)
- {
- await ServerProxy.AdminService.UpdateGatherCategoryAsync(_session.Id, id, name, gatherers);
- }
- /// <summary>
- /// get Gather Category by id
- /// </summary>
- /// <returns></returns>
- public async Task<GatherCategory> GetGatherCategoryByIdAsync(long id)
- {
- return await ServerProxy.AdminService.GetGatherCategoryByIdAsync(_session.Id, id);
- }
- /// <summary>
- /// Get Gather Categories
- /// </summary>
- /// <returns></returns>
- public async Task<List<GatherCategory>> GetGatherCategoriesByOrganizationIdAsync(long organizationId)
- {
- return await ServerProxy.AdminService.GetGatherCategoriesByOrganizationIdAsync(_session.Id, organizationId);
- }
- /// <summary>
- /// Get Gather Categories
- /// </summary>
- /// <returns></returns>
- public async Task<List<GatherCategory>> GetGatherCategoriesAsync(int pageIndex, int pageSize, SearchGatherCategoryModel searchGatherCategoryModel)
- {
- return await ServerProxy.AdminService.GetGatherCategoriesAsync(_session.Id, pageIndex, pageSize, searchGatherCategoryModel);
- }
- /// <summary>
- /// Get Gather Categories Count
- /// </summary>
- /// <returns></returns>
- public async Task<long> GetGatherCategoriesCountAsync(SearchGatherCategoryModel searchGatherCategoryModel)
- {
- return await ServerProxy.AdminService.GetGatherCategoriesCountAsync(_session.Id, searchGatherCategoryModel);
- }
- /// <summary>
- /// Create Gather Data
- /// </summary>
- /// <returns></returns>
- public async Task CreateGatherDataAsync(CategoryItem category, EntityBase organziation, EntityBase gatherer, string modelType, string source, int collectionQuantity, DateTime startTime, DateTime endTime, DateTime settlementTime)
- {
- await ServerProxy.AdminService.CreateGatherDataAsync(_session.Id, category, organziation, gatherer, modelType, source, collectionQuantity, startTime, endTime, settlementTime);
- }
- /// <summary>
- /// Update Gather Data
- /// </summary>
- /// <returns></returns>
- public async Task UpdateGatherDataAsync(long id, CategoryItem category, EntityBase organziation, EntityBase gatherer, string modelType, string source, int collectionQuantity, DateTime startTime, DateTime endTime, DateTime settlementTime)
- {
- await ServerProxy.AdminService.UpdateGatherDataAsync(_session.Id, id, category, organziation, gatherer, modelType, source, collectionQuantity, startTime, endTime, settlementTime);
- }
- /// <summary>
- /// get Gather Data by id
- /// </summary>
- /// <returns></returns>
- public async Task<GatherData> GetGatherDataByIdAsync(long id)
- {
- return await ServerProxy.AdminService.GetGatherDataByIdAsync(_session.Id, id);
- }
- /// <summary>
- /// Get Gather Datas
- /// </summary>
- /// <returns></returns>
- public async Task<List<GatherData>> GetGatherDatasAsync(int pageIndex, int pageSize, SearchGatherDataModel searchGatherDataModel)
- {
- return await ServerProxy.AdminService.GetGatherDatasAsync(_session.Id, pageIndex, pageSize, searchGatherDataModel);
- }
- /// <summary>
- /// Get Gather Datas Count
- /// </summary>
- /// <returns></returns>
- public async Task<long> GetGatherDatasCountAsync(SearchGatherDataModel searchGatherDataModel)
- {
- return await ServerProxy.AdminService.GetGatherDatasCountAsync(_session.Id, searchGatherDataModel);
- }
- #endregion GatherCategory
- #region 定价管理
- /// <summary>
- /// 获取个体定价数据
- /// </summary>
- /// <param name="organizationId">组织Id</param>
- /// <param name="type">标注/审核/采集类型</param>
- /// <returns></returns>
- public async Task<List<IndividualPrice>> GetIndividualPricesAsync(long organizationId, DataProcessingType type)
- {
- return await ServerProxy.AdminService.GetIndividualPricesAsync(_session.Id, organizationId, type);
- }
- /// <summary>
- /// 新增个体定价
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public async Task CreateIndividualPriceAsync(IndividualPrice item)
- {
- await ServerProxy.AdminService.CreateIndividualPriceAsync(_session.Id, item);
- }
- /// <summary>
- /// 更新个体定价
- /// </summary>
- /// <param name="price"></param>
- /// <returns></returns>
- public async Task UpdateIndividualPriceAsync(long id, double price)
- {
- await ServerProxy.AdminService.UpdateIndividualPriceAsync(_session.Id, id, price);
- }
- /// <summary>
- /// 获取个体系数
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The loaded developers.</returns>
- public async Task<List<IndividualCoefficient>> GetIndividualCoefficientsAsync(int pageIndex, int pageSize, string keyword, long organizationId)
- {
- return await ServerProxy.AdminService.GetIndividualCoefficientsAsync(_session.Id, pageIndex, pageSize, keyword, organizationId);
- }
- /// <summary>
- /// 获取个体系数数量
- /// </summary>
- /// <param name="keyword">The searched keyword.</param>
- /// <returns>The developer count.</returns>
- public async Task<int> GetIndividualCoefficientsCountAsync(string keyword, long organizationId)
- {
- return await ServerProxy.AdminService.GetIndividualCoefficientsCountAsync(_session.Id, keyword, organizationId);
- }
- /// <summary>
- /// 新增个体系数
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public async Task CreateIndividualCoefficientAsync(IndividualCoefficient item)
- {
- await ServerProxy.AdminService.CreateIndividualCoefficientAsync(_session.Id, item);
- }
- /// <summary>
- /// 更新个体系数
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public async Task UpdateIndividualCoefficientAsync(long id, double labelPriceCoefficient, double labelQuantityCoefficient, DateTime? startEffectiveTime, DateTime? endEffectiveTime)
- {
- await ServerProxy.AdminService.UpdateIndividualCoefficientAsync(_session.Id, id, labelPriceCoefficient, labelQuantityCoefficient, startEffectiveTime, endEffectiveTime);
- }
- /// <summary>
- /// 删除个体系数
- /// </summary>
- /// <returns></returns>
- public async Task DeleteIndividualCoefficientAsync(long id)
- {
- await ServerProxy.AdminService.DeleteIndividualCoefficientAsync(_session.Id, id);
- }
- /// <summary>
- /// 获取机构定价
- /// </summary>
- /// <param name="pageIndex">The index of page.</param>
- /// <param name="pageSize">The item count per page.</param>
- /// <returns>The loaded developers.</returns>
- public async Task<List<InstitutionalPrice>> GetInstitutionalPricesAsync(int pageIndex, int pageSize, long organizationId, long institutionId)
- {
- return await ServerProxy.AdminService.GetInstitutionalPricesAsync(_session.Id, pageIndex, pageSize, organizationId, institutionId);
- }
- /// <summary>
- /// 获取机构定价数量
- /// </summary>
- /// <returns>The developer count.</returns>
- public async Task<int> GetInstitutionalPricesCountAsync(long organizationId, long institutionId)
- {
- return await ServerProxy.AdminService.GetInstitutionalPricesCountAsync(_session.Id, organizationId, institutionId);
- }
- /// <summary>
- /// 新增机构定价
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public async Task CreateInstitutionalPriceAsync(InstitutionalPrice item)
- {
- await ServerProxy.AdminService.CreateInstitutionalPriceAsync(_session.Id, item);
- }
- /// <summary>
- /// 更新机构定价
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public async Task UpdateInstitutionalPriceAsync(long id, double labelPrice, double reviewPrice, double gatherPrice, double labelPriceCoefficient, double labelQuantityCoefficient, DateTime? startEffectiveTime, DateTime? endEffectiveTime)
- {
- await ServerProxy.AdminService.UpdateInstitutionalPriceAsync(_session.Id, id, labelPrice, reviewPrice, gatherPrice, labelPriceCoefficient, labelQuantityCoefficient, startEffectiveTime, endEffectiveTime);
- }
- /// <summary>
- /// 删除机构定价
- /// </summary>
- /// <returns></returns>
- public async Task DeleteInstitutionalPriceAsync(long id)
- {
- await ServerProxy.AdminService.DeleteInstitutionalPriceAsync(_session.Id, id);
- }
- /// <summary>
- /// 创建定价相关操作记录
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public async Task CreatePricingOperateLogAsync(PricingOperateLog item)
- {
- await ServerProxy.AdminService.CreatePricingOperateLogAsync(_session.Id, item);
- }
- /// <summary>
- /// 获取定价相关操作记录
- /// </summary>
- /// <returns></returns>
- public async Task<List<PricingOperateLog>> GetPricingOperateLogsAsync(int pageIndex, int pageSize, long id, PricingType type)
- {
- return await ServerProxy.AdminService.GetPricingOperateLogsAsync(_session.Id, pageIndex, pageSize, id, type);
- }
- /// <summary>
- /// 获取定价相关操作记录数量
- /// </summary>
- /// <returns></returns>
- public async Task<int> GetPricingOperateLogsCountAsync(long id, PricingType type)
- {
- return await ServerProxy.AdminService.GetPricingOperateLogsCountAsync(_session.Id, id, type);
- }
- #endregion 定价管理
- }
- }
|