refactor: prefix Mi for all entities (misskey-dev#11719) (MisskeyIO#160)

cheery-pick from misskey-dev@792622aeadf3e36d50cddec3c64b2ff0105ea927
This commit is contained in:
まっちゃとーにゅ
2023-08-26 08:42:29 +09:00
committed by GitHub
parent 651905e08f
commit 58bbff3738
234 changed files with 2061 additions and 2061 deletions

View File

@@ -7,8 +7,8 @@ import { Inject, Injectable } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
import type { NotesRepository, UsersRepository } from '@/models/index.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
import type { LocalUser, RemoteUser, User } from '@/models/entities/User.js';
import type { Note } from '@/models/entities/Note.js';
import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/entities/User.js';
import type { MiNote } from '@/models/entities/Note.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { bindThis } from '@/decorators.js';
@@ -29,7 +29,7 @@ export class GetterService {
* Get note for API processing
*/
@bindThis
public async getNote(noteId: Note['id']) {
public async getNote(noteId: MiNote['id']) {
const note = await this.notesRepository.findOneBy({ id: noteId });
if (note == null) {
@@ -43,21 +43,21 @@ export class GetterService {
* Get user for API processing
*/
@bindThis
public async getUser(userId: User['id']) {
public async getUser(userId: MiUser['id']) {
const user = await this.usersRepository.findOneBy({ id: userId });
if (user == null) {
throw new IdentifiableError('15348ddd-432d-49c2-8a5a-8069753becff', 'No such user.');
}
return user as LocalUser | RemoteUser;
return user as MiLocalUser | MiRemoteUser;
}
/**
* Get remote user for API processing
*/
@bindThis
public async getRemoteUser(userId: User['id']) {
public async getRemoteUser(userId: MiUser['id']) {
const user = await this.getUser(userId);
if (!this.userEntityService.isRemoteUser(user)) {
@@ -71,7 +71,7 @@ export class GetterService {
* Get local user for API processing
*/
@bindThis
public async getLocalUser(userId: User['id']) {
public async getLocalUser(userId: MiUser['id']) {
const user = await this.getUser(userId);
if (!this.userEntityService.isLocalUser(user)) {