# Myhomes

## 미니홈피 조회

<mark style="color:blue;">`GET`</mark> `https://sparta-jyh.shop/users/:myhomeId`

가입된 유저의 미니홈피를 불러옵니다.

#### Path Parameters

| Name                                       | Type   | Description     |
| ------------------------------------------ | ------ | --------------- |
| myhomeId<mark style="color:red;">\*</mark> | String | 가입된 유저의 미니홈피 번호 |

{% tabs %}
{% tab title="200: OK 가입된 유저" %}

<pre class="language-json"><code class="lang-json">{
<strong>	"data": {
</strong>		"myhomeId": [MYHOMEID],
		"userId": [USERID],
		"intro": "[INTRO]",
		"profile": "[PROFILE_IMAGE_URL]",
		"today": [TODAY]
		"total": [TOTAL],
		"createdAt": "[CREATEDAT]",
		"updatedAt": "[UPDATEDAT]",
		"user": {
			"userId": [USERID],
			"email": "[EMAIL]",
			"name": "[NAME]",
			"gender": "[GENDER]",
			"birth": "[BIRTH]",
			"role": "[ROLE]",
			"createdAt": "[CREATEDAT]",
			"updatedAt": "[UPDATEDAT]"
		}
	}
}
</code></pre>

myhomeId : 미니홈피 번호 \
userId : 회원번호 \
intro : 소개글 \
profile : 프로필 이미지 주소 \
today : 일일 방문자 수 \
total : 전체 방문자 수 \
createdAt : 회원가입 날짜 \
updatedAt : 수정 날짜 \
user : 가입된 유저 정보

{% tabs %}
{% tab title="userId" %}
회원번호
{% endtab %}

{% tab title="email" %}
가입된 회원의 이메일
{% endtab %}

{% tab title="name" %}
가입된 회원의 이름
{% endtab %}

{% tab title="gender" %}
가입된 회원의 성별
{% endtab %}

{% tab title="birth" %}
가입된 회원의 생일
{% endtab %}

{% tab title="role" %}
가입된 회원의 권한 \
"user" - 기본값, 일반유저 \
"admin" - 관리자
{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="400: Bad Request 가입되지 않은 유저" %}

```
존재하지 않는 미니홈피 입니다.
```

요청한 미니홈피 번호가 존재하지 않을시 발생하는 오류입니다.
{% endtab %}
{% endtabs %}

## 미니홈피 소개글 및 사진 변경

<mark style="color:orange;">`PUT`</mark> `https://sparta-jyh.shop/users/:myhomeId`

미니홈피 소개글 또는 프로필 사진을 수정합니다.

#### Path Parameters

| Name                                       | Type   | Description     |
| ------------------------------------------ | ------ | --------------- |
| myhomeId<mark style="color:red;">\*</mark> | String | 가입된 유저의 미니홈피 번호 |

#### Request Body

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| intro   | String | 미니홈피 소개글    |
| profile | File   | 미니홈피 프로필 사진 |

{% tabs %}
{% tab title="201: Created 수정 성공" %}

```typescript
intro가 수정되었습니다.
```

{% endtab %}

{% tab title="403: Forbidden 타인의 소개글 수정 시도" %}

```typescript
본인 소개글만 수정가능합니다.
```

타인의 미니홈피 소개글 수정 시도할 시 발생하는 오류입니다.
{% endtab %}

{% tab title="404: Not Found 잘못된 요청" %}

```typescript
잘못된 요청입니다.
```

존재하지 않는 미니홈피 호출 시 발생하는 오류입니다.
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jangs-organization.gitbook.io/api/api/myhomes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
